remove change image and minor refactoring

This commit is contained in:
JFH
2021-08-13 14:37:55 +02:00
parent 57c43e441f
commit b50fe0aee1
12 changed files with 125 additions and 128 deletions

View File

@@ -217,7 +217,7 @@ export default {
);
dataStorage.put(ethis, 'c_' + pos, part.id);
dataStorage.put(ethis, pos + '_bb', svgCanvas.getStrokedBBox([ part ]));
} else part = document.getElementById(part);
} else part = $id(part);
parts.push(part);
}, ethis);

View File

@@ -32,7 +32,7 @@ export default {
await loadExtensionTranslation(svgEditor);
const { svgCanvas } = svgEditor;
const { $id } = svgCanvas;
const svgdoc = document.getElementById('svgcanvas').ownerDocument;
const svgdoc = $id('svgcanvas').ownerDocument;
const { assignAttributes } = svgCanvas;
const hcanvas = document.createElement('canvas');
const canvBG = $id('canvasBackground');
@@ -154,7 +154,7 @@ export default {
updateGrid(svgCanvas.getZoom());
}
$id('canvasGrid').style.display = (showGrid) ? 'block' : 'none';
document.getElementById('view_grid').pressed = showGrid;
$id('view_grid').pressed = showGrid;
};
return {
name: svgEditor.i18next.t(`${name}:name`),

View File

@@ -71,12 +71,12 @@ export default {
$id("overview_window_view_box").style.top = viewBoxY + 'px';
$id("overview_window_view_box").style.left = viewBoxX + 'px';
};
document.getElementById('workarea').addEventListener('scroll', () => {
$id('workarea').addEventListener('scroll', () => {
if (!(overviewWindowGlobals.viewBoxDragging)) {
updateViewBox();
}
});
document.getElementById('workarea').addEventListener('resize', updateViewBox);
$id('workarea').addEventListener('resize', updateViewBox);
updateViewBox();
// Compensate for changes in zoom and canvas size.

View File

@@ -258,9 +258,9 @@ export default {
cy: opts.start_y,
id: svgCanvas.getNextId(),
shape: "star",
point: document.getElementById("starNumPoints").value,
point: $id("starNumPoints").value,
r: 0,
radialshift: document.getElementById("radialShift").value,
radialshift: $id("radialShift").value,
r2: 0,
orient: "point",
fill: rgb,
@@ -287,7 +287,7 @@ export default {
cy: opts.start_y,
id: svgCanvas.getNextId(),
shape: "regularPoly",
sides: document.getElementById("polySides").value,
sides: $id("polySides").value,
orient: "x",
edge: 0,
fill: rgb,