Skip to content

Commit

Permalink
Fix/dxf scale (#2528)
Browse files Browse the repository at this point in the history
* Feature: Change version tag

* Fix: Remove log info
  • Loading branch information
Raywh authored Nov 13, 2024
1 parent 2a7bff2 commit e44dd39
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "snapmaker-luban",
"version": "4.13.1-beta.1.2",
"version": "4.13.1-beta.1.3",
"description": "A web-based interface for Snapmaker 3-in-1 3D Printer",
"homepage": "https://github.com/Snapmaker/Luban",
"author": "Snapmaker Software Team",
Expand Down
22 changes: 14 additions & 8 deletions src/app/flux/editor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -812,14 +812,20 @@ export const actions = {
} else {
const extname = path.extname(uploadName);
const isScale = !includes(scaleExtname, extname);

const newModelSize = sourceType !== SOURCE_TYPE.IMAGE3D
? limitModelSizeByMachineSize(coordinateSize, sourceWidth, sourceHeight, isLimit, isScale)
: sizeModel(size, materials, sourceWidth, sourceHeight);

width = newModelSize?.width;
height = newModelSize?.height;
scale = newModelSize?.scale;
const originalExtname = path.extname(originalName).toLowerCase();
if (originalExtname !== '.dxf') {
const newModelSize = sourceType !== SOURCE_TYPE.IMAGE3D && sourceType !== SOURCE_TYPE.SVG
? limitModelSizeByMachineSize(coordinateSize, sourceWidth, sourceHeight, isLimit, isScale)
: sizeModel(size, materials, sourceWidth, sourceHeight);

width = newModelSize?.width;
height = newModelSize?.height;
scale = newModelSize?.scale;
} else {
width = sourceWidth;
height = sourceHeight;
scale = 1;
}
}

if (`${headType}-${sourceType}-${mode}` === 'cnc-raster-greyscale') {
Expand Down

0 comments on commit e44dd39

Please sign in to comment.