mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-05 00:40:37 +08:00
Avoid using wxString Printf, instead use Format() and use wxRealPoint (floating point) instead of wxPoint (integer)
This commit is contained in:
parent
97cb562890
commit
a559c57a81
@ -76,11 +76,8 @@ void Plate2D::repaint(wxPaintEvent& e) {
|
|||||||
dc->SetTextForeground(wxColor(0,0,0));
|
dc->SetTextForeground(wxColor(0,0,0));
|
||||||
dc->SetFont(wxFont(10, wxFONTFAMILY_ROMAN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
|
dc->SetFont(wxFont(10, wxFONTFAMILY_ROMAN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
|
||||||
|
|
||||||
wxString val {};
|
dc->DrawLabel(wxString::Format("X = %.0f", this->print_center.x), wxRect(0,0, center.x*2, this->GetSize().GetHeight()), wxALIGN_CENTER_HORIZONTAL | wxALIGN_BOTTOM);
|
||||||
val.Printf("X = %.0f", this->print_center.x);
|
dc->DrawRotatedText(wxString::Format("Y = %.0f", this->print_center.y), 0, center.y + 15, 90);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,8 +90,8 @@ private:
|
|||||||
void update_bed_size();
|
void update_bed_size();
|
||||||
|
|
||||||
/// private class variables to stash bits for drawing the print bed area.
|
/// private class variables to stash bits for drawing the print bed area.
|
||||||
wxPoint bed_origin {};
|
wxRealPoint bed_origin {};
|
||||||
wxPoint print_center {};
|
wxRealPoint print_center {};
|
||||||
Slic3r::Polygon bed_polygon {};
|
Slic3r::Polygon bed_polygon {};
|
||||||
std::vector<wxPoint> grid {};
|
std::vector<wxPoint> grid {};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user