Avoid using wxString Printf, instead use Format() and use wxRealPoint (floating point) instead of wxPoint (integer)

This commit is contained in:
Joseph Lenox 2018-05-06 17:55:59 -05:00 committed by Joseph Lenox
parent 97cb562890
commit a559c57a81
2 changed files with 4 additions and 7 deletions

View File

@ -76,11 +76,8 @@ void Plate2D::repaint(wxPaintEvent& e) {
dc->SetTextForeground(wxColor(0,0,0));
dc->SetFont(wxFont(10, wxFONTFAMILY_ROMAN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
wxString val {};
val.Printf("X = %.0f", this->print_center.x);
dc->DrawLabel(val , wxRect(0,0, center.x*2, this->GetSize().GetHeight()), wxALIGN_CENTER_HORIZONTAL | wxALIGN_BOTTOM);
val.Printf("Y = %.0f", this->print_center.y);
dc->DrawRotatedText(val, 0, center.y + 15, 90);
dc->DrawLabel(wxString::Format("X = %.0f", this->print_center.x), wxRect(0,0, center.x*2, this->GetSize().GetHeight()), wxALIGN_CENTER_HORIZONTAL | wxALIGN_BOTTOM);
dc->DrawRotatedText(wxString::Format("Y = %.0f", this->print_center.y), 0, center.y + 15, 90);
}
}

View File

@ -90,8 +90,8 @@ private:
void update_bed_size();
/// private class variables to stash bits for drawing the print bed area.
wxPoint bed_origin {};
wxPoint print_center {};
wxRealPoint bed_origin {};
wxRealPoint print_center {};
Slic3r::Polygon bed_polygon {};
std::vector<wxPoint> grid {};