Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add height and width measurement tools #997
base: master
Are you sure you want to change the base?
Add height and width measurement tools #997
Changes from 22 commits
29fe260
dd016be
ab0fc01
5f7aa1a
16009ce
79c0ecd
6977efa
15abc6b
9ea6e76
2cf0245
7b93d6e
1aff6ec
e67eb56
5517257
463af55
99901ee
2ad84e2
76e5f2a
b030042
9a76d73
8a56391
68b802b
04354a4
c88347c
3709bbe
a0724c2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
@saaaaaally Can omit the startPoint/endPoint check since that will be taken care of in the super call.
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.
Removed
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.
@saaaaaally iTwin localization allows passing arguments when getting the localized string, e.g. instead of
{0}
you can have it as{{value}}
and pass in a json object with{ value: fDistance }
. that's more robust than doing a string replace here.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.
Done
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.
@saaaaaally You don't need to do the string replace still,
getLocalizedString
's second argument is a TranslationOptions, and the localization library will replace{{value}}
automatically when you pass in{value: fDistance}
.https://www.itwinjs.org/learning/frontend/localization/
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.
Fixed
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.
@saaaaaally Similar to the other comments,
super.writeToJSON
will already have written out startPoint/endPoint/showAxes to the json object.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.
Done
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.
@saaaaaally Should convert
this._secondaryLine
to an array of XYZProps, calling Point3d'stoJSON
method. While technically it's valid as written (Point3d instances can mimic XYZProps), it's still good practice to make sure the returned JSON is only primitive data + separate object instances from the original object, to allow callers to mutate it without side effects.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.
Done
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.
@saaaaaally Using
as
here doesn't do anything more than satisfy the type checker, which was already satisfied byPoint3d
being the same shape asXYZProps
.I was suggesting something more like
this._secondaryLine ? this._secondaryLine.map((p) => p.toJSON()) : undefined
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.
Fixed