- Fix: Centering of canvas wasn't being set at proper time; fixes #272
- Refactoring: Avoid unneeded internal IIFEs; simplify w/h formulamaster
parent
5d9da2d56e
commit
c37e60fd87
|
@ -12,6 +12,7 @@
|
|||
- Fix: Allow language to be properly set back to a different locale and
|
||||
retaining preference (and ensure language changes are available before
|
||||
dialog closed)
|
||||
- Fix: Centering of canvas wasn't being set at proper time; fixes #272
|
||||
- Fix (regression): Extension locale loading for non-English locales
|
||||
- Enhancement: Allow "Escape" to work with hotkeys within text boxes;
|
||||
allows escaping out of source textarea (part of #291)
|
||||
|
@ -20,6 +21,7 @@
|
|||
- Enhancement: Add a global escape key listener to clear the selection
|
||||
- Refactoring: Change 'a' to lower case in key command to avoid impression
|
||||
that shift is needed
|
||||
- Refactoring: Avoid unneeded internal IIFEs; simplify w/h formula
|
||||
- Refactoring: array extra/spread operator
|
||||
- npm: Update devDeps
|
||||
|
||||
|
|
|
@ -307,7 +307,7 @@ var svgEditorExtension_storage = (function () {
|
|||
svgEditor.storagePromptClosed = true;
|
||||
}, null, null, {
|
||||
label: rememberLabel,
|
||||
checked: false,
|
||||
checked: true,
|
||||
tooltip: rememberTooltip
|
||||
});
|
||||
} else if (!noStorageOnLoad || forceStorage) {
|
||||
|
|
|
@ -20962,8 +20962,8 @@ function SvgCanvas(container, config) {
|
|||
var bg = $$9('#canvasBackground')[0];
|
||||
var oldX = svgcontent.getAttribute('x');
|
||||
var oldY = svgcontent.getAttribute('y');
|
||||
var x = w / 2 - this.contentW * currentZoom / 2;
|
||||
var y = h / 2 - this.contentH * currentZoom / 2;
|
||||
var x = (w - this.contentW * currentZoom) / 2;
|
||||
var y = (h - this.contentH * currentZoom) / 2;
|
||||
assignAttributes(svgcontent, {
|
||||
width: this.contentW * currentZoom,
|
||||
height: this.contentH * currentZoom,
|
||||
|
@ -28450,6 +28450,7 @@ editor.init = function () {
|
|||
$$b('.flyout_arrow_horiz:empty').each(function () {
|
||||
$$b(this).append($$b.getSvgIcon('arrow_right', true).width(5).height(5));
|
||||
});
|
||||
updateCanvas(true);
|
||||
messageQueue.forEach(
|
||||
/**
|
||||
* @param {module:svgcanvas.SvgCanvas#event:message} messageObj
|
||||
|
@ -32441,7 +32442,6 @@ editor.init = function () {
|
|||
}; // Fix for Issue 781: Drawing area jumps to top-left corner on window resize (IE9)
|
||||
|
||||
if (isIE()) {
|
||||
(function () {
|
||||
resetScrollPos = function resetScrollPos() {
|
||||
if (workarea[0].scrollLeft === 0 && workarea[0].scrollTop === 0) {
|
||||
workarea[0].scrollLeft = curScrollPos.left;
|
||||
|
@ -32467,7 +32467,6 @@ editor.init = function () {
|
|||
top: workarea[0].scrollTop
|
||||
};
|
||||
});
|
||||
})();
|
||||
}
|
||||
|
||||
$$b(window).resize(function (evt) {
|
||||
|
@ -32478,8 +32477,6 @@ editor.init = function () {
|
|||
});
|
||||
setFlyoutPositions();
|
||||
});
|
||||
|
||||
(function () {
|
||||
workarea.scroll(function () {
|
||||
// TODO: jQuery's scrollLeft/Top() wouldn't require a null check
|
||||
if ($$b('#ruler_x').length) {
|
||||
|
@ -32490,8 +32487,6 @@ editor.init = function () {
|
|||
$$b('#ruler_y')[0].scrollTop = workarea[0].scrollTop;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
$$b('#url_notice').click(function () {
|
||||
$$b.alert(this.title);
|
||||
});
|
||||
|
@ -34047,14 +34042,11 @@ editor.init = function () {
|
|||
$$b('#tool_open').show().prepend(open);
|
||||
var imgImport = $$b('<input type="file">').change(importImage);
|
||||
$$b('#tool_import').show().prepend(imgImport);
|
||||
} // $(function () {
|
||||
|
||||
|
||||
updateCanvas(true); // });
|
||||
// const revnums = 'svg-editor.js ($Rev$) ';
|
||||
} // const revnums = 'svg-editor.js ($Rev$) ';
|
||||
// revnums += svgCanvas.getVersion();
|
||||
// $('#copyright')[0].setAttribute('title', revnums);
|
||||
|
||||
|
||||
var loadedExtensionNames = [];
|
||||
/**
|
||||
* @function module:SVGEditor.setLang
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -20968,8 +20968,8 @@
|
|||
var bg = $$9('#canvasBackground')[0];
|
||||
var oldX = svgcontent.getAttribute('x');
|
||||
var oldY = svgcontent.getAttribute('y');
|
||||
var x = w / 2 - this.contentW * currentZoom / 2;
|
||||
var y = h / 2 - this.contentH * currentZoom / 2;
|
||||
var x = (w - this.contentW * currentZoom) / 2;
|
||||
var y = (h - this.contentH * currentZoom) / 2;
|
||||
assignAttributes(svgcontent, {
|
||||
width: this.contentW * currentZoom,
|
||||
height: this.contentH * currentZoom,
|
||||
|
@ -28456,6 +28456,7 @@
|
|||
$$b('.flyout_arrow_horiz:empty').each(function () {
|
||||
$$b(this).append($$b.getSvgIcon('arrow_right', true).width(5).height(5));
|
||||
});
|
||||
updateCanvas(true);
|
||||
messageQueue.forEach(
|
||||
/**
|
||||
* @param {module:svgcanvas.SvgCanvas#event:message} messageObj
|
||||
|
@ -32447,7 +32448,6 @@
|
|||
}; // Fix for Issue 781: Drawing area jumps to top-left corner on window resize (IE9)
|
||||
|
||||
if (isIE()) {
|
||||
(function () {
|
||||
resetScrollPos = function resetScrollPos() {
|
||||
if (workarea[0].scrollLeft === 0 && workarea[0].scrollTop === 0) {
|
||||
workarea[0].scrollLeft = curScrollPos.left;
|
||||
|
@ -32473,7 +32473,6 @@
|
|||
top: workarea[0].scrollTop
|
||||
};
|
||||
});
|
||||
})();
|
||||
}
|
||||
|
||||
$$b(window).resize(function (evt) {
|
||||
|
@ -32484,8 +32483,6 @@
|
|||
});
|
||||
setFlyoutPositions();
|
||||
});
|
||||
|
||||
(function () {
|
||||
workarea.scroll(function () {
|
||||
// TODO: jQuery's scrollLeft/Top() wouldn't require a null check
|
||||
if ($$b('#ruler_x').length) {
|
||||
|
@ -32496,8 +32493,6 @@
|
|||
$$b('#ruler_y')[0].scrollTop = workarea[0].scrollTop;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
$$b('#url_notice').click(function () {
|
||||
$$b.alert(this.title);
|
||||
});
|
||||
|
@ -34053,14 +34048,11 @@
|
|||
$$b('#tool_open').show().prepend(open);
|
||||
var imgImport = $$b('<input type="file">').change(importImage);
|
||||
$$b('#tool_import').show().prepend(imgImport);
|
||||
} // $(function () {
|
||||
|
||||
|
||||
updateCanvas(true); // });
|
||||
// const revnums = 'svg-editor.js ($Rev$) ';
|
||||
} // const revnums = 'svg-editor.js ($Rev$) ';
|
||||
// revnums += svgCanvas.getVersion();
|
||||
// $('#copyright')[0].setAttribute('title', revnums);
|
||||
|
||||
|
||||
var loadedExtensionNames = [];
|
||||
/**
|
||||
* @function module:SVGEditor.setLang
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -819,6 +819,7 @@ editor.init = function () {
|
|||
$('.flyout_arrow_horiz:empty').each(function () {
|
||||
$(this).append($.getSvgIcon('arrow_right', true).width(5).height(5));
|
||||
});
|
||||
updateCanvas(true);
|
||||
messageQueue.forEach(
|
||||
/**
|
||||
* @param {module:svgcanvas.SvgCanvas#event:message} messageObj
|
||||
|
@ -2089,6 +2090,7 @@ editor.init = function () {
|
|||
updateRulers(cnvs, zoom);
|
||||
workarea.scroll();
|
||||
}
|
||||
|
||||
if (urldata.storagePrompt !== true && !editor.storagePromptClosed) {
|
||||
$('#dialog_box').hide();
|
||||
}
|
||||
|
@ -4504,7 +4506,6 @@ editor.init = function () {
|
|||
|
||||
// Fix for Issue 781: Drawing area jumps to top-left corner on window resize (IE9)
|
||||
if (isIE()) {
|
||||
(() => {
|
||||
resetScrollPos = function () {
|
||||
if (workarea[0].scrollLeft === 0 && workarea[0].scrollTop === 0) {
|
||||
workarea[0].scrollLeft = curScrollPos.left;
|
||||
|
@ -4532,7 +4533,6 @@ editor.init = function () {
|
|||
top: workarea[0].scrollTop
|
||||
};
|
||||
});
|
||||
})();
|
||||
}
|
||||
|
||||
$(window).resize(function (evt) {
|
||||
|
@ -4544,7 +4544,6 @@ editor.init = function () {
|
|||
setFlyoutPositions();
|
||||
});
|
||||
|
||||
(() => {
|
||||
workarea.scroll(function () {
|
||||
// TODO: jQuery's scrollLeft/Top() wouldn't require a null check
|
||||
if ($('#ruler_x').length) {
|
||||
|
@ -4554,7 +4553,6 @@ editor.init = function () {
|
|||
$('#ruler_y')[0].scrollTop = workarea[0].scrollTop;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
$('#url_notice').click(function () {
|
||||
$.alert(this.title);
|
||||
|
@ -5723,10 +5721,6 @@ editor.init = function () {
|
|||
$('#tool_import').show().prepend(imgImport);
|
||||
}
|
||||
|
||||
// $(function () {
|
||||
updateCanvas(true);
|
||||
// });
|
||||
|
||||
// const revnums = 'svg-editor.js ($Rev$) ';
|
||||
// revnums += svgCanvas.getVersion();
|
||||
// $('#copyright')[0].setAttribute('title', revnums);
|
||||
|
|
|
@ -7005,8 +7005,8 @@ this.updateCanvas = function (w, h) {
|
|||
const bg = $('#canvasBackground')[0];
|
||||
const oldX = svgcontent.getAttribute('x');
|
||||
const oldY = svgcontent.getAttribute('y');
|
||||
const x = (w / 2 - this.contentW * currentZoom / 2);
|
||||
const y = (h / 2 - this.contentH * currentZoom / 2);
|
||||
const x = ((w - this.contentW * currentZoom) / 2);
|
||||
const y = ((h - this.contentH * currentZoom) / 2);
|
||||
|
||||
assignAttributes(svgcontent, {
|
||||
width: this.contentW * currentZoom,
|
||||
|
@ -7032,6 +7032,7 @@ this.updateCanvas = function (w, h) {
|
|||
}
|
||||
|
||||
selectorManager.selectorParentGroup.setAttribute('transform', 'translate(' + x + ',' + y + ')');
|
||||
|
||||
/**
|
||||
* Invoked upon updates to the canvas.
|
||||
* @event module:svgcanvas.SvgCanvas#event:ext-canvasUpdated
|
||||
|
|
|
@ -20965,8 +20965,8 @@
|
|||
var bg = $$9('#canvasBackground')[0];
|
||||
var oldX = svgcontent.getAttribute('x');
|
||||
var oldY = svgcontent.getAttribute('y');
|
||||
var x = w / 2 - this.contentW * currentZoom / 2;
|
||||
var y = h / 2 - this.contentH * currentZoom / 2;
|
||||
var x = (w - this.contentW * currentZoom) / 2;
|
||||
var y = (h - this.contentH * currentZoom) / 2;
|
||||
assignAttributes(svgcontent, {
|
||||
width: this.contentW * currentZoom,
|
||||
height: this.contentH * currentZoom,
|
||||
|
@ -28453,6 +28453,7 @@
|
|||
$$b('.flyout_arrow_horiz:empty').each(function () {
|
||||
$$b(this).append($$b.getSvgIcon('arrow_right', true).width(5).height(5));
|
||||
});
|
||||
updateCanvas(true);
|
||||
messageQueue.forEach(
|
||||
/**
|
||||
* @param {module:svgcanvas.SvgCanvas#event:message} messageObj
|
||||
|
@ -32444,7 +32445,6 @@
|
|||
}; // Fix for Issue 781: Drawing area jumps to top-left corner on window resize (IE9)
|
||||
|
||||
if (isIE()) {
|
||||
(function () {
|
||||
resetScrollPos = function resetScrollPos() {
|
||||
if (workarea[0].scrollLeft === 0 && workarea[0].scrollTop === 0) {
|
||||
workarea[0].scrollLeft = curScrollPos.left;
|
||||
|
@ -32470,7 +32470,6 @@
|
|||
top: workarea[0].scrollTop
|
||||
};
|
||||
});
|
||||
})();
|
||||
}
|
||||
|
||||
$$b(window).resize(function (evt) {
|
||||
|
@ -32481,8 +32480,6 @@
|
|||
});
|
||||
setFlyoutPositions();
|
||||
});
|
||||
|
||||
(function () {
|
||||
workarea.scroll(function () {
|
||||
// TODO: jQuery's scrollLeft/Top() wouldn't require a null check
|
||||
if ($$b('#ruler_x').length) {
|
||||
|
@ -32493,8 +32490,6 @@
|
|||
$$b('#ruler_y')[0].scrollTop = workarea[0].scrollTop;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
$$b('#url_notice').click(function () {
|
||||
$$b.alert(this.title);
|
||||
});
|
||||
|
@ -34050,14 +34045,11 @@
|
|||
$$b('#tool_open').show().prepend(open);
|
||||
var imgImport = $$b('<input type="file">').change(importImage);
|
||||
$$b('#tool_import').show().prepend(imgImport);
|
||||
} // $(function () {
|
||||
|
||||
|
||||
updateCanvas(true); // });
|
||||
// const revnums = 'svg-editor.js ($Rev$) ';
|
||||
} // const revnums = 'svg-editor.js ($Rev$) ';
|
||||
// revnums += svgCanvas.getVersion();
|
||||
// $('#copyright')[0].setAttribute('title', revnums);
|
||||
|
||||
|
||||
var loadedExtensionNames = [];
|
||||
/**
|
||||
* @function module:SVGEditor.setLang
|
||||
|
|
|
@ -20965,8 +20965,8 @@
|
|||
var bg = $$9('#canvasBackground')[0];
|
||||
var oldX = svgcontent.getAttribute('x');
|
||||
var oldY = svgcontent.getAttribute('y');
|
||||
var x = w / 2 - this.contentW * currentZoom / 2;
|
||||
var y = h / 2 - this.contentH * currentZoom / 2;
|
||||
var x = (w - this.contentW * currentZoom) / 2;
|
||||
var y = (h - this.contentH * currentZoom) / 2;
|
||||
assignAttributes(svgcontent, {
|
||||
width: this.contentW * currentZoom,
|
||||
height: this.contentH * currentZoom,
|
||||
|
@ -28453,6 +28453,7 @@
|
|||
$$b('.flyout_arrow_horiz:empty').each(function () {
|
||||
$$b(this).append($$b.getSvgIcon('arrow_right', true).width(5).height(5));
|
||||
});
|
||||
updateCanvas(true);
|
||||
messageQueue.forEach(
|
||||
/**
|
||||
* @param {module:svgcanvas.SvgCanvas#event:message} messageObj
|
||||
|
@ -32444,7 +32445,6 @@
|
|||
}; // Fix for Issue 781: Drawing area jumps to top-left corner on window resize (IE9)
|
||||
|
||||
if (isIE()) {
|
||||
(function () {
|
||||
resetScrollPos = function resetScrollPos() {
|
||||
if (workarea[0].scrollLeft === 0 && workarea[0].scrollTop === 0) {
|
||||
workarea[0].scrollLeft = curScrollPos.left;
|
||||
|
@ -32470,7 +32470,6 @@
|
|||
top: workarea[0].scrollTop
|
||||
};
|
||||
});
|
||||
})();
|
||||
}
|
||||
|
||||
$$b(window).resize(function (evt) {
|
||||
|
@ -32481,8 +32480,6 @@
|
|||
});
|
||||
setFlyoutPositions();
|
||||
});
|
||||
|
||||
(function () {
|
||||
workarea.scroll(function () {
|
||||
// TODO: jQuery's scrollLeft/Top() wouldn't require a null check
|
||||
if ($$b('#ruler_x').length) {
|
||||
|
@ -32493,8 +32490,6 @@
|
|||
$$b('#ruler_y')[0].scrollTop = workarea[0].scrollTop;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
$$b('#url_notice').click(function () {
|
||||
$$b.alert(this.title);
|
||||
});
|
||||
|
@ -34050,14 +34045,11 @@
|
|||
$$b('#tool_open').show().prepend(open);
|
||||
var imgImport = $$b('<input type="file">').change(importImage);
|
||||
$$b('#tool_import').show().prepend(imgImport);
|
||||
} // $(function () {
|
||||
|
||||
|
||||
updateCanvas(true); // });
|
||||
// const revnums = 'svg-editor.js ($Rev$) ';
|
||||
} // const revnums = 'svg-editor.js ($Rev$) ';
|
||||
// revnums += svgCanvas.getVersion();
|
||||
// $('#copyright')[0].setAttribute('title', revnums);
|
||||
|
||||
|
||||
var loadedExtensionNames = [];
|
||||
/**
|
||||
* @function module:SVGEditor.setLang
|
||||
|
|
Loading…
Reference in New Issue