You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Changed anchor constants to enum, removed ANCHOR_CENTER, fixes #9889
This commit is contained in:
@@ -779,7 +779,7 @@ float CanvasItemEditor::_anchor_snap(float p_anchor, bool *p_snapped, float p_op
|
||||
bool snapped = false;
|
||||
float dist, dist_min = 0.0;
|
||||
float radius = 0.05 / zoom;
|
||||
float basic_anchors[3] = { ANCHOR_BEGIN, ANCHOR_CENTER, ANCHOR_END };
|
||||
float basic_anchors[3] = { 0.0, 0.5, 1.0 };
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if ((dist = fabs(p_anchor - basic_anchors[i])) < radius) {
|
||||
if (!snapped || dist <= dist_min) {
|
||||
|
||||
Reference in New Issue
Block a user