-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/tree scale #346
Feature/tree scale #346
Conversation
…ersatile with units
- Unit character is removed from input string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wat kleine optimalisaties maar niet perse nodig
double.TryParse(position.zField.Text, out var z); | ||
var numberFormat = new NumberFormatInfo | ||
{ | ||
NumberDecimalSeparator = "." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strings die vaker gebruikt gaan worden altijd cachen. dit is veel memory allocatie, dus bv. NumberDecimalSeparator = defaultNumberSeperator;
float.TryParse(rotation.zField.Text, out var z); | ||
var numberFormat = new NumberFormatInfo | ||
{ | ||
NumberDecimalSeparator = "." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idem
float.TryParse(scale.zField.Text.Replace(percentageCharacter, ""), out var z); | ||
var numberFormat = new NumberFormatInfo | ||
{ | ||
NumberDecimalSeparator = "." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hiephoi
|
||
TransformPropertyData.LocalScale = new Vector3(x / 100.0f, y / 100.0f, z / 100.0f); | ||
TransformPropertyData.LocalScale = new Vector3(x / scaleMultiplier, y / scaleMultiplier, z / scaleMultiplier); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
misschien omdat ik te weinig kennis heb van dit onderdeel maar met een multiplier verwacht ik een * operator, moet de input waarde zijn inverse zijn?
scale.xField.SetTextWithoutNotify($"{xPercentage.ToString("0", CultureInfo.InvariantCulture)}{percentageCharacter}"); | ||
scale.yField.SetTextWithoutNotify($"{yPercentage.ToString("0", CultureInfo.InvariantCulture)}{percentageCharacter}"); | ||
scale.zField.SetTextWithoutNotify($"{zPercentage.ToString("0", CultureInfo.InvariantCulture)}{percentageCharacter}"); | ||
return format; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string defaultZero = "0";
string defaultZeroSeperator = "0.";
en
format += defaultZero;
nog beter een stringbuilder maar dat is in dit geval overkill
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
netjes
https://cdn-dev-ams-3da.azureedge.net/autobuild/feature/tree-scale/345478263/