Fix decimal precision loss when previewing number.

This commit is contained in:
Tanasart 2024-11-26 12:51:09 +07:00
parent fc4e49517f
commit 7583993028
1057 changed files with 868 additions and 856 deletions

View file

@ -2248,13 +2248,13 @@
{"name":"s_node_junction_inspector","order":19,"path":"sprites/s_node_junction_inspector/s_node_junction_inspector.yy",},
{"name":"s_node_junction_name_bg","order":20,"path":"sprites/s_node_junction_name_bg/s_node_junction_name_bg.yy",},
{"name":"s_node_junction_selecting","order":33,"path":"sprites/s_node_junction_selecting/s_node_junction_selecting.yy",},
{"name":"s_node_junctions_bg_2x","order":37,"path":"sprites/s_node_junctions_bg_2x/s_node_junctions_bg_2x.yy",},
{"name":"s_node_junctions_bg","order":38,"path":"sprites/s_node_junctions_bg/s_node_junctions_bg.yy",},
{"name":"s_node_junctions_outline_2x","order":35,"path":"sprites/s_node_junctions_outline_2x/s_node_junctions_outline_2x.yy",},
{"name":"s_node_junctions_bg_2x","order":35,"path":"sprites/s_node_junctions_bg_2x/s_node_junctions_bg_2x.yy",},
{"name":"s_node_junctions_bg","order":34,"path":"sprites/s_node_junctions_bg/s_node_junctions_bg.yy",},
{"name":"s_node_junctions_outline_2x","order":37,"path":"sprites/s_node_junctions_outline_2x/s_node_junctions_outline_2x.yy",},
{"name":"s_node_junctions_outline_hover_2x","order":39,"path":"sprites/s_node_junctions_outline_hover_2x/s_node_junctions_outline_hover_2x.yy",},
{"name":"s_node_junctions_outline_hover","order":40,"path":"sprites/s_node_junctions_outline_hover/s_node_junctions_outline_hover.yy",},
{"name":"s_node_junctions_outline_hover","order":38,"path":"sprites/s_node_junctions_outline_hover/s_node_junctions_outline_hover.yy",},
{"name":"s_node_junctions_outline","order":36,"path":"sprites/s_node_junctions_outline/s_node_junctions_outline.yy",},
{"name":"s_node_junctions_single","order":34,"path":"sprites/s_node_junctions_single/s_node_junctions_single.yy",},
{"name":"s_node_junctions_single","order":40,"path":"sprites/s_node_junctions_single/s_node_junctions_single.yy",},
{"name":"s_node_kuwahara","order":31,"path":"sprites/s_node_kuwahara/s_node_kuwahara.yy",},
{"name":"s_node_level_selector","order":33,"path":"sprites/s_node_level_selector/s_node_level_selector.yy",},
{"name":"s_node_level","order":32,"path":"sprites/s_node_level/s_node_level.yy",},

Binary file not shown.

View file

@ -42,7 +42,7 @@
static setFrame = function(_frame, _round = true) {
var _c = current_frame;
_frame = clamp(_frame, 0, frames_total);
// _frame = clamp(_frame, 0, frames_total);
real_frame = _frame;
current_frame = _round? round(_frame) : _frame;

View file

@ -681,8 +681,8 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
var _ou = preview_channel >= 0 && preview_channel < array_length(outputs) && outputs[preview_channel].type == VALUE_TYPE.surface;
var _prev_surf = previewable && preview_draw && (_ps || _ou);
junction_draw_hei_y = SHOW_PARAM? 32 : 24;
junction_draw_pad_y = SHOW_PARAM? 128 : 32;
junction_draw_hei_y = SHOW_PARAM? 32 : 16;
junction_draw_pad_y = SHOW_PARAM? 128 : 24;
var _hi, _ho;
@ -1247,6 +1247,13 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
return self;
}
static setPreviewable = function(prev) {
if(previewable == prev) return;
previewable = prev;
y += previewable? -16 : 16;
}
static onInspect = function() {}
static pointIn = function(_x, _y, _mx, _my, _s) {
@ -1554,6 +1561,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
static drawJunctions = function(_draw, _x, _y, _mx, _my, _s) {
var hover = noone;
gpu_set_texfilter(true);
for(var i = 0, n = array_length(inputDisplayList); i < n; i++) { //inputs
var jun = inputDisplayList[i];
@ -1595,6 +1603,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
onDrawJunctions(_x, _y, _mx, _my, _s);
gpu_set_texfilter(false);
return hover;
}

View file

@ -115,7 +115,7 @@ function Node_Number(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
if(disp == 0 || inputs[0].value_from != noone || bbox.h < line_get_height(f_p2)) {
draw_set_text(f_sdf, fa_center, fa_center, COLORS._main_text);
draw_text_bbox(bbox, string(val));
draw_text_bbox(bbox, string_real(val));
return;
}
@ -123,7 +123,7 @@ function Node_Number(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
case 1 :
draw_set_text(f_sdf, fa_center, fa_center, _col);
draw_text_transformed(bbox.xc, bbox.y0 + 16 * _s, string(val), _s * 0.5, _s * 0.5, 0);
draw_text_transformed(bbox.xc, bbox.y0 + 16 * _s, string_real(val), _s * 0.5, _s * 0.5, 0);
var sl_w = bbox.w - 8 * _s;
var sl_h = _s * 40;
@ -232,8 +232,8 @@ function Node_Number(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
draggable = false;
}
draw_set_text(f_sdf, fa_center, fa_center, colorMultiply(CDEF.main_white, _col));
draw_text_transformed(bbox.xc, bbox.yc, val, _s * .5, _s * .5, 0);
draw_set_text(f_sdf, fa_center, fa_center, _col);
draw_text_transformed(bbox.xc, bbox.yc, string_real(val, 999, 3), _s * .5, _s * .5, 0);
break;
}
}

View file

@ -1980,7 +1980,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
var _draw_cc = COLORS._main_text;
var _draw_aa = 0.6 + hover_in_graph * 0.4;
var _f = node.previewable? f_p1 : f_p3;
var _f = node.previewable? f_p2 : f_p3;
draw_set_text(_f, fa_left, fa_center, _draw_cc);
draw_set_alpha(_draw_aa);

View file

@ -771,7 +771,9 @@ function Panel_Animation() : PanelContent() constructor {
if(timeline_scubbing) {
var rfrm = (mx - bar_x - timeline_shift) / timeline_scale - 1;
PROJECT.animator.setFrame(clamp(rfrm, 0, TOTAL_FRAMES - 1), !key_mod_press(ALT));
// rfrm = clamp(rfrm, 0, TOTAL_FRAMES - 1); // clamp to animating region
PROJECT.animator.setFrame(rfrm, !key_mod_press(ALT));
timeline_show_time = CURRENT_FRAME;
if(timeline_show_time != _scrub_frame) {
@ -2543,7 +2545,8 @@ function Panel_Animation() : PanelContent() constructor {
if(point_in_rectangle(mx, my, ui(8), y0, w - ui(16), y1)) {
if(mouse_click(mb_left, pFOCUS)) {
var rfrm = (mx - ui(8)) / (w - ui(16)) * TOTAL_FRAMES;
PROJECT.animator.setFrame(clamp(rfrm, 0, TOTAL_FRAMES - 1));
// rfrm = clamp(rfrm, 0, TOTAL_FRAMES - 1); // clamp to animating region
PROJECT.animator.setFrame(rfrm);
}
}

View file

@ -620,7 +620,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
__temp_show = false;
array_foreach(nodes_selecting, function(node, index) {
if(index == 0) __temp_show = !node.previewable;
node.previewable = __temp_show;
node.setPreviewable(__temp_show);
node.refreshNodeDisplay();
});
}
@ -1205,7 +1205,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
function drawCacheCheck(_x, _y, _s, _w, _h) {
var _upd = false;
_upd |= pFOCUS && mouse_click(mb_any);
_upd |= pFOCUS && (mouse_click(mb_any) || keyboard_check_pressed(vk_anykey));
_upd |= draw_refresh; draw_refresh = false;
_upd |= connection_cache[$ "_x"] != _x; connection_cache[$ "_x"] = _x;

View file

@ -87,7 +87,7 @@ function string_compare(s1, s2) {
}
function array_to_string(arr) {
if(!is_array(arr)) return string(arr);
if(!is_array(arr)) return string_real(arr);
if(array_empty(arr)) return "[]";
var s = "[";

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B

View file

@ -2,9 +2,9 @@
"$GMSprite":"",
"%Name":"s_junc_aseprite",
"bboxMode":0,
"bbox_bottom":35,
"bbox_bottom":20,
"bbox_left":0,
"bbox_right":35,
"bbox_right":20,
"bbox_top":0,
"collisionKind":1,
"collisionTolerance":0,
@ -12,14 +12,14 @@
"edgeFiltering":false,
"For3D":false,
"frames":[
{"$GMSpriteFrame":"","%Name":"e60e12c6-85ae-4302-b2e9-d2f935920dd9","name":"e60e12c6-85ae-4302-b2e9-d2f935920dd9","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
{"$GMSpriteFrame":"","%Name":"ba2fd5bf-123d-4001-8ec8-ae32bd57ec0b","name":"ba2fd5bf-123d-4001-8ec8-ae32bd57ec0b","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
],
"gridX":0,
"gridY":0,
"height":36,
"height":21,
"HTile":false,
"layers":[
{"$GMImageLayer":"","%Name":"ad507ec9-d601-44ba-b597-d2c2e78911f3","blendMode":0,"displayName":"default","isLocked":false,"name":"ad507ec9-d601-44ba-b597-d2c2e78911f3","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,},
{"$GMImageLayer":"","%Name":"763ef73d-bd88-464b-99b2-56d6076551fa","blendMode":0,"displayName":"default","isLocked":false,"name":"763ef73d-bd88-464b-99b2-56d6076551fa","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,},
],
"name":"s_junc_aseprite",
"nineSlice":null,
@ -69,14 +69,14 @@
"tracks":[
{"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore<SpriteFrameKeyframe>":"","Keyframes":[
{"$Keyframe<SpriteFrameKeyframe>":"","Channels":{
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"e60e12c6-85ae-4302-b2e9-d2f935920dd9","path":"sprites/s_junc_aseprite/s_junc_aseprite.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"d9c71224-4acb-4ee4-b5d1-eaebd6549e14","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"ba2fd5bf-123d-4001-8ec8-ae32bd57ec0b","path":"sprites/s_junc_aseprite/s_junc_aseprite.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"66d194e0-2aa7-4087-8c26-c406b202736b","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
],"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],
"visibleRange":null,
"volume":1.0,
"xorigin":18,
"yorigin":18,
"xorigin":10,
"yorigin":10,
},
"swatchColours":null,
"swfPrecision":0.5,
@ -86,5 +86,5 @@
},
"type":0,
"VTile":false,
"width":36,
"width":21,
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 510 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 424 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 B

Some files were not shown because too many files have changed in this diff Show more