Fix maths used for converting between model coordinates and pixels (and vice-versa)

This commit is contained in:
Joseph Lenox 2018-05-08 23:12:15 -05:00
parent 70b81db7f9
commit daece6e4c0
2 changed files with 2 additions and 2 deletions

View File

@ -348,7 +348,7 @@ wxPoint Plate2D::unscaled_point_to_pixel(const wxPoint& in) {
const auto& zero = this->bed_origin;
return wxPoint(
in.x * this->scaling_factor + zero.x,
in.y * this->scaling_factor + (zero.y - canvas_height));
canvas_height - in.y * this->scaling_factor + (zero.y - canvas_height));
}

View File

@ -120,7 +120,7 @@ private:
const auto& zero {this->bed_origin};
return Slic3r::Point(
scale_(x - zero.x) / this->scaling_factor,
scale_(y - zero.y) / this->scaling_factor
scale_(zero.y - y) / this->scaling_factor
);
}
Slic3r::Point point_to_model_units(const wxPoint& pt) {