diff --git a/aegisub/src/agi_pre.h b/aegisub/src/agi_pre.h index b2664a7a4..706756c72 100644 --- a/aegisub/src/agi_pre.h +++ b/aegisub/src/agi_pre.h @@ -152,7 +152,6 @@ #include #include #include -#include #include #include #include diff --git a/aegisub/src/vector2d.cpp b/aegisub/src/vector2d.cpp index 8fb9477b7..d1e3640ca 100644 --- a/aegisub/src/vector2d.cpp +++ b/aegisub/src/vector2d.cpp @@ -27,8 +27,6 @@ #ifndef AGI_PRE #include - -#include #endif Vector2D::Vector2D() @@ -91,9 +89,13 @@ wxString Vector2D::DStr(char sep) const { return wxString::Format("%d%c%d", (int)x, sep, (int)y); } -wxString Vector2D::Str(char sep) const { - return - wxNumberFormatter::ToString(x, 3, wxNumberFormatter::Style_NoTrailingZeroes) + - sep + - wxNumberFormatter::ToString(y, 3, wxNumberFormatter::Style_NoTrailingZeroes); +static wxString float_to_string(float val) { + wxString s = wxString::Format("%.3f", val); + size_t pos = s.find_last_not_of("0"); + if (pos != s.find(".")) ++pos; + return s.Left(pos); +} + +wxString Vector2D::Str(char sep) const { + return float_to_string(x) + sep + float_to_string(y); }