fix: Area Measurement units and MeasureMark visibility #673
+4
−11
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.
Description
This PR fixes two related issues affecting area/volume measurements and their label visibility (closes #668):
BEFORE:

AFTER:

Area and volume are scaled incorrectly, causing small measurements (e.g. m2 -> km2) to collapse to 0 even with high precision (5).
The unit conversion utility already defines factors for area (m², km²) and volume (m³, km³) in the unitFactors variable.
```
const unitFactors: Record<string, number> = {
// Length
m: 1,
cm: 0.01,
mm: 0.001,
km: 1000,
// Area
m2: 1,
cm2: 0.0001,
mm2: 0.000001,
km2: 1000000,
// Volume
m3: 1,
cm3: 0.000001,
mm3: 0.000000001,
km3: 1000000000,
};
However, the conversion logic applied an additional exponentiation step, effectively scaling the values twice.
MeasureMark visibility:
The MeasureMark visibility was determined using the area’s value property. Since value applies unit conversion and rounding (default precision: 2), small measurements (e.g. m² → km²) were converted to 0. As a result, the label were turned off, negatively affecting the user experience. The solution is to use the rawValue instead, which preserves the original area value in m².
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following:
feat(examples): add hello-world example).fixes #123).