From 8ee605d1ae593198d0595f4e96b64a3b7a0d48b6 Mon Sep 17 00:00:00 2001 From: Tanasart Date: Mon, 8 Jul 2024 09:43:38 +0700 Subject: [PATCH] - [Graph Panel] Fix preview scale error when zoom out very far. --- scripts/__bbox/__bbox.gml | 4 ++-- scripts/node_crop/node_crop.gml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/__bbox/__bbox.gml b/scripts/__bbox/__bbox.gml index e05f414bd..310c7015e 100644 --- a/scripts/__bbox/__bbox.gml +++ b/scripts/__bbox/__bbox.gml @@ -82,8 +82,8 @@ function __BBOX() constructor { xc = (x0 + x1) / 2; yc = (y0 + y1) / 2; - w = x1 - x0; - h = y1 - y0; + w = max(0, abs(x1 - x0)); + h = max(0, abs(y1 - y0)); return self; } diff --git a/scripts/node_crop/node_crop.gml b/scripts/node_crop/node_crop.gml index b557e0590..f65cc8b4f 100644 --- a/scripts/node_crop/node_crop.gml +++ b/scripts/node_crop/node_crop.gml @@ -93,7 +93,7 @@ function Node_Crop(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons inputs[| 6].setVisible(_asp > 0 && _fit == 0); } - static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, params) { #region + static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, params) { PROCESSOR_OVERLAY_CHECK var _inSurf = current_data[0]; @@ -332,7 +332,7 @@ function Node_Crop(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons draw_rectangle(_px0, _py0, _px1, _py1, true); } - } #endregion + } static onValueUpdate = function(index) { if(index != 3) return; @@ -347,7 +347,7 @@ function Node_Crop(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons inputs[| 6].setValue(min(_dim[0], _dim[1] * _ratio)); } - static processData = function(_outSurf, _data, _output_index, _array_index) { #region + static processData = function(_outSurf, _data, _output_index, _array_index) { var _inSurf = _data[0]; var _crop = _data[1]; var _asp = _data[3]; @@ -410,5 +410,5 @@ function Node_Crop(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons } return _outSurf; - } #endregion + } } \ No newline at end of file