Skip to content

Commit

Permalink
Fix Center(X,Y) Error (#2563)
Browse files Browse the repository at this point in the history
* Update build-on-create-release.yml

* Update build-on-create-release.yml

* Feature: Support material test

Support material test

* Feature: Support material test

not support auto delete

* Feature: Support material test

fix cannot genarate gcode bug

* Feature: Support material test

fix cannot genarate gcode bug

* Feature: Support material test

new alpha version

* Feature: Support material test

update nightly build relaese id

* Fix: Nightly build fix

Nightly build fix

* Update build-on-pull-request.yml

* Fix: Nightly build fix

Nightly build fix

* Fix: Rollback workflow

Rollback workflow

* Fix: Rollback workflow

Rollback workflow

* Fix: Remove excess logs

Remove excess logs

* Fix: Cannot Init default value

Init default value by other way

* Fix: Change default multiPasses value

Change default multiPasses value

* Fix: Support ToolPathConfig setting

Support ToolPathConfig setting

* Fix: Support ToolPathConfig setting

Support ToolPathConfig setting

* Fix: Toolpath to much

Let All word's toolPath In One

* Fix: Update to beta version

Update to beta version

* Fix: Not support undo or redo

Support undo or redo and ceate more time

* Feature: Upgrade print setting

Upgrade print setting

* Feature: Add Print Setting Param's i18n

Add Printing Setting i18n

* Fix: Update MaterialTest Rule

 Update MaterialTest Rule

* Fix: Update beta version

 Update beta version to support new print setting

* Fix: Update Default Test Config

Update Default Test Config

* Fix: Out of coordinateSize error

Out of coordinateSize can't close preview bug

* Fix: Center X And Center Y calculate bug

Center X And Center Y calculate must use base SVGActions.X/Y
  • Loading branch information
leo-songye-li authored Jan 6, 2025
1 parent 70dfed5 commit 63ca3a9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
21 changes: 14 additions & 7 deletions src/app/flux/editor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1693,11 +1693,17 @@ export const actions = {
// headTitleGap just use between head title and rects
const headTitleGap = 4;
const baseStyle = {
titleHeight: 3,
titleFontSize: 8.6,
titleHeight: 2.5,
titleFontSize: 7,
numHeight: 2,
numFontSize: 5.8,
};
if ((rectHeight < rectWidth ? rectHeight : rectWidth) > 4) {
baseStyle.titleHeight = 3;
baseStyle.titleFontSize = 8.5;
baseStyle.numHeight = 2;
baseStyle.numFontSize = 5.8;
}
if ((rectHeight < rectWidth ? rectHeight : rectWidth) > 6) {
baseStyle.titleHeight = 4;
baseStyle.titleFontSize = 11.2;
Expand All @@ -1708,15 +1714,16 @@ export const actions = {
const maxHeight = rectRows * (rectHeight + rectGap) - rectGap + headTitleGap + (titleGap + baseStyle.titleHeight) * 2 + baseStyle.numHeight;
progress(0.05);
// 越界判断
console.log(`maxWidth:${maxWidth},maxHeight:${maxHeight}`);
if (maxWidth > coordinateSize.x || maxHeight > coordinateSize.y) {
progress(-1);
toast(makeSceneToast('warning', 'Cannot creat too much rect'));
log.error(`越界,svgWidth:${maxWidth},svgHeight:${maxHeight}`);
return;
}

const position = {
x: coordinateSize.x + coordinateMode.setting.sizeMultiplyFactor.x * coordinateSize.x / 2 - maxWidth / 2,
y: coordinateSize.y - coordinateMode.setting.sizeMultiplyFactor.y * coordinateSize.y / 2 + maxHeight / 2
x: SVGActions.size.x + coordinateMode.setting.sizeMultiplyFactor.x * coordinateSize.x / 2 - maxWidth / 2,
y: SVGActions.size.y - coordinateMode.setting.sizeMultiplyFactor.y * coordinateSize.y / 2 + maxHeight / 2
};

const toolPathBase = {
Expand Down Expand Up @@ -1754,8 +1761,8 @@ export const actions = {
x: curX,
y: curY,
'font-size': fontSize,
'font-family': 'Arial Black',
style: 'Aril-Regular',
'font-family': 'Aril regular',
style: 'Regular',
alignment: 'left',
textContent: text,
height: h,
Expand Down
4 changes: 2 additions & 2 deletions src/app/ui/views/MaterialTestConfigurations/FormStyles.styl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}

.form-item {
width: 120px;
width: 190px;
margin-right: 10px;
margin-bottom: 12px !important;
}
Expand All @@ -62,7 +62,7 @@
.input-suffix {
position: absolute;
top: 5px;
right: 15px;
right: 3px;
color: #b9bcbf;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ const MaterialTestConfigurations: React.FC<MaterialTestConfigurationsProps> = ({
{i18n._('key-Laser/MainToolBar-MaterialTesting')}
{/* </Modal.Title> */}
</Modal.Header>
<Modal.Body style={{ height: '540px', overflow: 'initial' }}>
<Modal.Body style={{ height: '540px', width: '470px', overflow: 'initial' }}>
<MaterialTestParameters
setCurrentToolDefinition={(definition) => actions.setToolDefinitionAndRemember(definition)}
gcodeConfig={gcodeConfig}
Expand Down

0 comments on commit 63ca3a9

Please sign in to comment.