summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authormarxin <mliska@suse.cz>2019-03-05 21:18:46 +0100
committermarxin <mliska@suse.cz>2019-03-05 21:18:46 +0100
commit0e781aeacbf0f349c5b592b52b2175d5cc0581c6 (patch)
treece7a83b53a9b83e9fe9c69663c0b99682e053307 /servers
parentc40877bc6ac81ecf0b8dc70ad1c708ac1b2bf167 (diff)
Fix #25641 by not shifting a negative value.
Diffstat (limited to 'servers')
-rw-r--r--servers/visual/visual_server_viewport.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/servers/visual/visual_server_viewport.h b/servers/visual/visual_server_viewport.h
index 4e3015c020..5176551540 100644
--- a/servers/visual/visual_server_viewport.h
+++ b/servers/visual/visual_server_viewport.h
@@ -90,7 +90,8 @@ public:
}
CanvasKey(const RID &p_canvas, int p_layer, int p_sublayer) {
canvas = p_canvas;
- stacking = ((int64_t)p_layer << 32) + p_sublayer;
+ int64_t sign = p_layer < 0 ? -1 : 1;
+ stacking = sign * (((int64_t)ABS(p_layer)) << 32) + p_sublayer;
}
int get_layer() const { return stacking >> 32; }
};