- [SVG In] Fix node not read svg file with extra tags.

This commit is contained in:
Tanasart 2024-06-23 07:51:35 +07:00
parent b5f227b5c5
commit 5ab7efb778
5 changed files with 13 additions and 10 deletions

View file

@ -228,11 +228,10 @@
break; break;
} }
if(!IS_CMD)PANEL_GRAPH.mouse_grid_y += 160; if(!IS_CMD) PANEL_GRAPH.mouse_grid_y += 160;
} }
if(node && !IS_CMD) // if(node && !IS_CMD) PANEL_GRAPH.toCenterNode();
PANEL_GRAPH.toCenterNode();
} }
} }
#endregion #endregion

View file

@ -38,7 +38,7 @@
LATEST_VERSION = 11700; LATEST_VERSION = 11700;
VERSION = 11742; VERSION = 11742;
SAVE_VERSION = 11700; SAVE_VERSION = 11700;
VERSION_STRING = "1.17.4.2"; VERSION_STRING = "1.17.5.001";
BUILD_NUMBER = 11742; BUILD_NUMBER = 11742;
globalvar HOTKEYS, HOTKEY_CONTEXT; globalvar HOTKEYS, HOTKEY_CONTEXT;

View file

@ -86,12 +86,12 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group)
inputs[| 9].setVisible(pack == SPRITE_STACK.grid); inputs[| 9].setVisible(pack == SPRITE_STACK.grid);
if(grup == SPRITE_ANIM_GROUP.animation) { if(grup == SPRITE_ANIM_GROUP.animation) {
inputs[| 8].editWidget.minn = FIRST_FRAME + 1; inputs[| 8].editWidget.slide_range[0] = FIRST_FRAME + 1;
inputs[| 8].editWidget.maxx = LAST_FRAME + 1; inputs[| 8].editWidget.slide_range[1] = LAST_FRAME + 1;
if(!user) inputs[| 8].setValueDirect([ FIRST_FRAME + 1, LAST_FRAME + 1], noone, false, 0, false); if(!user) inputs[| 8].setValueDirect([ FIRST_FRAME + 1, LAST_FRAME + 1], noone, false, 0, false);
} else { } else {
inputs[| 8].editWidget.minn = 0; inputs[| 8].editWidget.slide_range[0] = 0;
inputs[| 8].editWidget.maxx = array_length(inpt) - 1; inputs[| 8].editWidget.slide_range[1] = array_length(inpt) - 1;
if(!user) inputs[| 8].setValueDirect([ 0, array_length(inpt) - 1], noone, false, 0, false); if(!user) inputs[| 8].setValueDirect([ 0, array_length(inpt) - 1], noone, false, 0, false);
} }

View file

@ -58,6 +58,10 @@ function Node_SVG(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
if(ext != ".svg") return; if(ext != ".svg") return;
var _rawContent = file_text_read_all_lines(path); var _rawContent = file_text_read_all_lines(path);
var _st = string_pos("<svg", _rawContent);
var _end = string_length(_rawContent);
_rawContent = string_copy(_rawContent, _st, _end - _st + 1);
rawContent = SnapFromXML(_rawContent); rawContent = SnapFromXML(_rawContent);
content = svg_parse(rawContent); content = svg_parse(rawContent);

View file

@ -14,8 +14,8 @@ function svg_parse(xmlStr) {
var hh = struct_try_get(attr, "height", 1); var hh = struct_try_get(attr, "height", 1);
var svg = new SVG().setAttr(attr); var svg = new SVG().setAttr(attr);
svg.width = toNumber(string_digits(ww)); svg.width = toNumber(ww);
svg.height = toNumber(string_digits(hh)); svg.height = toNumber(hh);
if(struct_has(attr, "viewBox")) { if(struct_has(attr, "viewBox")) {
var bbox = attr.viewBox; var bbox = attr.viewBox;