mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-05 16:20:49 +08:00
Fix maths used for converting between model coordinates and pixels (and vice-versa)
This commit is contained in:
parent
062e0fa7dc
commit
3ff475d02b
@ -348,7 +348,7 @@ wxPoint Plate2D::unscaled_point_to_pixel(const wxPoint& in) {
|
|||||||
const auto& zero = this->bed_origin;
|
const auto& zero = this->bed_origin;
|
||||||
return wxPoint(
|
return wxPoint(
|
||||||
in.x * this->scaling_factor + zero.x,
|
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};
|
const auto& zero {this->bed_origin};
|
||||||
return Slic3r::Point(
|
return Slic3r::Point(
|
||||||
scale_(x - zero.x) / this->scaling_factor,
|
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) {
|
Slic3r::Point point_to_model_units(const wxPoint& pt) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user