From 9f5a76f89aeaca93ce6e6b104e21883637b0bd93 Mon Sep 17 00:00:00 2001 From: Tanasart Date: Sun, 7 Jul 2024 09:17:44 +0700 Subject: [PATCH] - [Shape] Fix empty output for negative width, height. --- scripts/node_shape/node_shape.gml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/node_shape/node_shape.gml b/scripts/node_shape/node_shape.gml index 8a643ed57..246523694 100644 --- a/scripts/node_shape/node_shape.gml +++ b/scripts/node_shape/node_shape.gml @@ -214,15 +214,15 @@ function Node_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con case 0 : var _area = _data[3]; - _center = [ _area[0] / _dim[0], _area[1] / _dim[1] ]; - _scale = [ _area[2] / _dim[0], _area[3] / _dim[1] ]; + _center = [ _area[0] / _dim[0], _area[1] / _dim[1] ]; + _scale = [ abs(_area[2] / _dim[0]), abs(_area[3] / _dim[1]) ]; break; case 1 : var _posit = _data[16]; var _scal = _data[17]; - _center = [ _posit[0] / _dim[0], _posit[1] / _dim[1] ]; - _scale = [ _scal[0] / _dim[0], _scal[1] / _dim[1] ]; + _center = [ _posit[0] / _dim[0], _posit[1] / _dim[1] ]; + _scale = [ abs(_scal[0] / _dim[0]), abs(_scal[1] / _dim[1]) ]; break; case 2 : _center = [ 0.5, 0.5 ];