Fixes bad gizmo alignment for textures with odd size
This commit is contained in:
parent
6cb841edcb
commit
a6c229bbfd
@ -93,7 +93,7 @@ Rect2 AnimatedSprite::_get_rect() const {
|
|||||||
|
|
||||||
Point2 ofs = offset;
|
Point2 ofs = offset;
|
||||||
if (centered)
|
if (centered)
|
||||||
ofs -= s / 2;
|
ofs -= Size2(s) / 2;
|
||||||
|
|
||||||
if (s == Size2(0, 0))
|
if (s == Size2(0, 0))
|
||||||
s = Size2(1, 1);
|
s = Size2(1, 1);
|
||||||
|
@ -363,7 +363,7 @@ Rect2 Sprite::get_rect() const {
|
|||||||
|
|
||||||
Point2 ofs = offset;
|
Point2 ofs = offset;
|
||||||
if (centered)
|
if (centered)
|
||||||
ofs -= s / 2;
|
ofs -= Size2(s) / 2;
|
||||||
|
|
||||||
if (s == Size2(0, 0))
|
if (s == Size2(0, 0))
|
||||||
s = Size2(1, 1);
|
s = Size2(1, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user