Skip to content

Commit

Permalink
Fix bounding box calculation
Browse files Browse the repository at this point in the history
Fixes oversight in previous commit.
  • Loading branch information
TheAssassin committed Apr 15, 2024
1 parent 5572070 commit c425533
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/de/thomas_oster/liblasercut/drivers/Ruida.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,10 @@ private void find_and_write_bounding_box(LaserJob job) throws IOException
/* compute bounding box */
for (JobPart p : job.getParts())
{
double min_x = Util.px2mm(p.getMinX(), p.getDPI());
double min_y = Util.px2mm(p.getMinY(), p.getDPI());
double max_x = Util.px2mm(p.getMaxX(), p.getDPI());
double max_y = Util.px2mm(p.getMaxY(), p.getDPI());
double min_x = isFlipXaxis() ? getBedWidth() - Util.px2mm(p.getMinX(), p.getDPI()) : Util.px2mm(p.getMinX(), p.getDPI());
double min_y = isFlipYaxis() ? getBedHeight() - Util.px2mm(p.getMinY(), p.getDPI()) : Util.px2mm(p.getMinY(), p.getDPI());
double max_x = isFlipXaxis() ? getBedWidth() - Util.px2mm(p.getMaxX(), p.getDPI()) : Util.px2mm(p.getMaxX(), p.getDPI());
double max_y = isFlipYaxis() ? getBedHeight() - Util.px2mm(p.getMaxY(), p.getDPI()) : Util.px2mm(p.getMaxY(), p.getDPI());
if (first) {
minX = min_x;
maxX = max_x;
Expand Down

0 comments on commit c425533

Please sign in to comment.