restrict ctOrigin offsets to ctOriginBounds

This commit is contained in:
Stewart Allen 2024-06-13 22:31:59 -04:00
commit f6f1d2478e
4 changed files with 7 additions and 10 deletions

View file

@ -447,7 +447,7 @@ function exportElements(settings, output, onpre, onpoly, onpost, onpoint, onlaye
last, last,
point, point,
poly = [], poly = [],
off = {x:ctOriginOffX||0, y:ctOriginOffY||0}, off = ctOriginBounds ? {x:ctOriginOffX||0, y:ctOriginOffY||0} : {x:0, y:0},
min = {x:0, y:0}, min = {x:0, y:0},
max = {x:0, y:0}, max = {x:0, y:0},
size = {w:0, h:0}; size = {w:0, h:0};

View file

@ -769,12 +769,9 @@ const conf = exports({
ctOriginCenter: false, ctOriginCenter: false,
ctOriginBounds: true, ctOriginBounds: true,
ctOriginOffX: 0, ctOriginOffX: 0,
ctOriginOffY: -10, ctOriginOffY: 0,
outputInvertX: false, outputInvertX: false,
outputInvertY: false, outputInvertY: false
ctOutKnifeDepth: 1,
ctOutKnifePasses: 1,
ctOutKnifeTip: 2
} }
} }
}, },

View file

@ -1970,9 +1970,9 @@ gapp.register("kiri.init", [], (root, exports) => {
separator: newBlank({ class:"set-sep", driven }), separator: newBlank({ class:"set-sep", driven }),
ctOriginBounds: newBoolean(LANG.or_bnds_s, onBooleanClick, {title:LANG.or_bnds_l, show:() => !ui.ctOriginCenter.checked}), ctOriginBounds: newBoolean(LANG.or_bnds_s, onBooleanClick, {title:LANG.or_bnds_l, show:() => !ui.ctOriginCenter.checked}),
ctOriginCenter: newBoolean(LANG.or_cntr_s, onBooleanClick, {title:LANG.or_cntr_l, show:() => !ui.ctOriginBounds.checked}), ctOriginCenter: newBoolean(LANG.or_cntr_s, onBooleanClick, {title:LANG.or_cntr_l, show:() => !ui.ctOriginBounds.checked}),
separator: newBlank({ class:"set-sep", driven, modes:WEDM }), separator: newBlank({ class:"set-sep", driven, modes:WEDM, show:() => ui.ctOriginBounds.checked }),
ctOriginOffX: newInput(LANG.or_offx_s, {title:LANG.or_offx_l, convert:toFloat, modes:WEDM}), ctOriginOffX: newInput(LANG.or_offx_s, {title:LANG.or_offx_l, convert:toFloat, modes:WEDM, show:() => ui.ctOriginBounds.checked}),
ctOriginOffY: newInput(LANG.or_offy_s, {title:LANG.or_offy_l, convert:toFloat, modes:WEDM}), ctOriginOffY: newInput(LANG.or_offy_s, {title:LANG.or_offy_l, convert:toFloat, modes:WEDM, show:() => ui.ctOriginBounds.checked}),
separator: newBlank({ class:"set-sep", driven, modes:TWONED }), separator: newBlank({ class:"set-sep", driven, modes:TWONED }),
ctOutZColor: newBoolean(LANG.ou_layo_s, onBooleanClick, {title:LANG.ou_layo_l, modes:TWONED, show:() => { return ui.ctOutMerged.checked === false }}), ctOutZColor: newBoolean(LANG.ou_layo_s, onBooleanClick, {title:LANG.ou_layo_l, modes:TWONED, show:() => { return ui.ctOutMerged.checked === false }}),
ctOutLayer: newBoolean(LANG.ou_layr_s, onBooleanClick, {title:LANG.ou_layr_l, modes:TWONED}), ctOutLayer: newBoolean(LANG.ou_layr_s, onBooleanClick, {title:LANG.ou_layr_l, modes:TWONED}),

View file

@ -100,7 +100,7 @@ function platformUpdateOrigin(update_bounds = true) {
} }
// WireEDM origin offsets // WireEDM origin offsets
if (MODE === MODES.WEDM) { if (MODE === MODES.WEDM && process.ctOriginBounds) {
origin.x -= process.ctOriginOffX; origin.x -= process.ctOriginOffX;
origin.y += process.ctOriginOffY; origin.y += process.ctOriginOffY;
} }