Skip to content

Commit fcd7589

Browse files
committed
minor fixes
1 parent 53b5fb2 commit fcd7589

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

2-ui/1-document/11-coordinates/article.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,17 @@ Please note:
7575
```smart header="Why derived properties are needed? Why does `top/left` exist if there's `x/y`?"
7676
Mathematically, a rectangle is uniquely defined with its starting point `(x,y)` and the direction vector `(width,height)`. So the additional derived properties are for convenience.
7777

78-
Technically it's possible for `width/height` to be negative, that allows for "directed" rectangle, e.g. to represent mouse selection with properly marked start and end.
78+
Technically it's possible for `width/height` to be negative, that allows for "directed" rectangle, e.g. to represent mouse selection with properly marked start and end.
79+
80+
Negative `width/height` values mean that the rectangle starts at its bottom-right corner and then "grows" left-upwards.
7981

8082
Here's a rectangle with negative `width` and `height` (e.g. `width=-200`, `height=-100`):
8183

8284
![](coordinates-negative.svg)
8385

84-
The rectangle starts at its bottom-right corner and then spans left/up, as negative `width/height` lead it backwards by coordinates.
85-
86-
As you can see, `left/top` are not `x/y` here. So these are actually not duplicates. Their formula can be adjusted to cover negative `width/height`, that's simple enough, but rarely needed, as the result of `elem.getBoundingClientRect()` always has positive width/height.
86+
As you can see, `left/top` do not equal `x/y` in such case.
8787

88-
Here we mention negative `width/height` only for you to understand why these seemingly duplicate properties are not actually duplicates.
88+
In practice though, `elem.getBoundingClientRect()` always returns positive width/height, here we mention negative `width/height` only for you to understand why these seemingly duplicate properties are not actually duplicates.
8989
```
9090
9191
```warn header="Internet Explorer and Edge: no support for `x/y`"

0 commit comments

Comments
 (0)