It's all integer points anyway.

This commit is contained in:
Joseph Lenox 2018-05-07 22:16:52 -05:00 committed by Joseph Lenox
parent 561cbe7145
commit dccc04bd8a
2 changed files with 5 additions and 3 deletions

View File

@ -251,8 +251,8 @@ void Plate2D::update_bed_size() {
this->scaling_factor = std::min(static_cast<double>(canvas_w) / unscale(size.x), static_cast<double>(canvas_h) / unscale(size.y));
this->bed_origin = wxPoint(
canvas_w / 2.0 - (unscale(bb.max.x + bb.min.x)/2.0 * this->scaling_factor),
canvas_h - (canvas_h / 2.0 - (unscale(bb.max.y + bb.min.y)/2.0 * this->scaling_factor))
canvas_w / 2 - (unscale(bb.max.x + bb.min.x)/2 * this->scaling_factor),
canvas_h - (canvas_h / 2 - (unscale(bb.max.y + bb.min.y)/2 * this->scaling_factor))
);
const auto& center = bb.center();

View File

@ -84,8 +84,10 @@ private:
wxPoint unscaled_point_to_pixel(const wxPoint& in);
/// Displacement needed to center bed.
wxPoint bed_origin {};
/// private class variables to stash bits for drawing the print bed area.
wxRealPoint bed_origin {};
wxRealPoint print_center {};
Slic3r::Polygon bed_polygon {};
std::vector<wxPoint> grid {};