1
0
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:
Juan Linietsky
2017-08-15 19:48:38 -03:00
parent f0b19137f9
commit 1ecb48b8c2
3 changed files with 14 additions and 8 deletions

View File

@@ -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) {