mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-04 14:50:40 +08:00
Fix maths used for converting between model coordinates and pixels (and vice-versa)
This commit is contained in:
parent
70b81db7f9
commit
daece6e4c0
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user