- [Graph Panel] Fix preview scale error when zoom out very far.

This commit is contained in:
Tanasart 2024-07-08 09:43:38 +07:00
parent e5d28abe59
commit 8ee605d1ae
2 changed files with 6 additions and 6 deletions

View file

@ -82,8 +82,8 @@ function __BBOX() constructor {
xc = (x0 + x1) / 2; xc = (x0 + x1) / 2;
yc = (y0 + y1) / 2; yc = (y0 + y1) / 2;
w = x1 - x0; w = max(0, abs(x1 - x0));
h = y1 - y0; h = max(0, abs(y1 - y0));
return self; return self;
} }

View file

@ -93,7 +93,7 @@ function Node_Crop(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
inputs[| 6].setVisible(_asp > 0 && _fit == 0); 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 PROCESSOR_OVERLAY_CHECK
var _inSurf = current_data[0]; 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); draw_rectangle(_px0, _py0, _px1, _py1, true);
} }
} #endregion }
static onValueUpdate = function(index) { static onValueUpdate = function(index) {
if(index != 3) return; 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)); 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 _inSurf = _data[0];
var _crop = _data[1]; var _crop = _data[1];
var _asp = _data[3]; var _asp = _data[3];
@ -410,5 +410,5 @@ function Node_Crop(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
} }
return _outSurf; return _outSurf;
} #endregion }
} }