mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 01:37:53 -06:00
Reverted a change in number text formatting.
Fixed some message wording.
This commit is contained in:
parent
3c4fa8859c
commit
c9f7965599
2 changed files with 29 additions and 5 deletions
|
@ -15,7 +15,31 @@ namespace Slic3r { namespace GUI {
|
||||||
|
|
||||||
wxString double_to_string(double const value, const int max_precision /*= 4*/)
|
wxString double_to_string(double const value, const int max_precision /*= 4*/)
|
||||||
{
|
{
|
||||||
return wxNumberFormatter::ToString(value, max_precision, wxNumberFormatter::Style_NoTrailingZeroes);
|
// Style_NoTrailingZeroes does not work on OSX. It also does not work correctly with some locales on Windows.
|
||||||
|
// return wxNumberFormatter::ToString(value, max_precision, wxNumberFormatter::Style_NoTrailingZeroes);
|
||||||
|
|
||||||
|
wxString s = wxNumberFormatter::ToString(value, max_precision, wxNumberFormatter::Style_None);
|
||||||
|
|
||||||
|
// The following code comes from wxNumberFormatter::RemoveTrailingZeroes(wxString& s)
|
||||||
|
// with the exception that here one sets the decimal separator explicitely to dot.
|
||||||
|
// If number is in scientific format, trailing zeroes belong to the exponent and cannot be removed.
|
||||||
|
if (s.find_first_of("eE") == wxString::npos) {
|
||||||
|
const size_t posDecSep = s.find(".");
|
||||||
|
// No decimal point => removing trailing zeroes irrelevant for integer number.
|
||||||
|
if (posDecSep != wxString::npos) {
|
||||||
|
// Find the last character to keep.
|
||||||
|
size_t posLastNonZero = s.find_last_not_of("0");
|
||||||
|
// If it's the decimal separator itself, don't keep it neither.
|
||||||
|
if (posLastNonZero == posDecSep)
|
||||||
|
-- posLastNonZero;
|
||||||
|
s.erase(posLastNonZero + 1);
|
||||||
|
// Remove sign from orphaned zero.
|
||||||
|
if (s.compare("-0") == 0)
|
||||||
|
s = "0";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Field::PostInitialize()
|
void Field::PostInitialize()
|
||||||
|
|
|
@ -716,12 +716,12 @@ void GLCanvas3D::WarningTexture::activate(WarningTexture::Warning warning, bool
|
||||||
std::string text;
|
std::string text;
|
||||||
bool red_colored = false;
|
bool red_colored = false;
|
||||||
switch (m_warnings.back()) {
|
switch (m_warnings.back()) {
|
||||||
case ObjectOutside : text = L("Detected object outside print volume"); break;
|
case ObjectOutside : text = L("An object outside the print area was detected"); break;
|
||||||
case ToolpathOutside : text = L("Detected toolpath outside print volume"); break;
|
case ToolpathOutside : text = L("A toolpath outside the print area was detected"); break;
|
||||||
case SomethingNotShown : text = L("Some objects are not visible when editing supports"); break;
|
case SomethingNotShown : text = L("Some objects are not visible when editing supports"); break;
|
||||||
case ObjectClashed: {
|
case ObjectClashed: {
|
||||||
text = L("Detected object outside print volume\n"
|
text = L("An object outside the print area was detected\n"
|
||||||
"Resolve a clash to continue slicing/export process correctly");
|
"Resolve the current problem to continue slicing");
|
||||||
red_colored = true;
|
red_colored = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue