-
Notifications
You must be signed in to change notification settings - Fork 8
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
Document meaning of position and size of rects #665
Conversation
@@ -22,14 +22,20 @@ export class SimulatedRegion { | |||
public readonly type = 'simulatedRegion'; | |||
|
|||
/** | |||
* top-left position | |||
* Position of the viewport. |
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.
* Position of the viewport. | |
* Position of the simulated region. |
@@ -22,14 +22,20 @@ export class SimulatedRegion { | |||
public readonly type = 'simulatedRegion'; | |||
|
|||
/** | |||
* top-left position | |||
* Position of the viewport. | |||
* For positive {@link size}s, this refers to the upper left corner of the simulated region, but during resizing, corners may be swapped. |
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.
* For positive {@link size}s, this refers to the upper left corner of the simulated region, but during resizing, corners may be swapped. | |
* For positive {@link size}s, this refers to the upper left corner of the simulated region, but after resizing, corners may be swapped. |
To make clear that this does not only happens while resizing (so in the act of it) but also persists thereafter.
* | ||
* @deprecated Do not access directly, use helper methods from models/utils/position/position-helpers(-mutable) instead. | ||
*/ | ||
@ValidateNested() | ||
@IsPosition() | ||
public readonly position: Position; | ||
|
||
/** | ||
* Size of the viewport. |
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.
* Size of the viewport. | |
* Size of the simulated region. |
* | ||
* @deprecated Do not access directly, use helper methods from models/utils/position/position-helpers(-mutable) instead. | ||
*/ | ||
@ValidateNested() | ||
@IsPosition() | ||
public readonly position: Position; | ||
|
||
/** | ||
* Size of the viewport. | ||
* The width of a viewport grows to the left, the height grows downwards. |
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.
* The width of a viewport grows to the left, the height grows downwards. | |
* The width of a simulated region grows to the left, the height grows downwards. |
@@ -21,14 +21,20 @@ export class Viewport { | |||
public readonly type = 'viewport'; | |||
|
|||
/** | |||
* top-left position | |||
* Position of the viewport. | |||
* For positive {@link size}s, this refers to the upper left corner of the viewport, but during resizing, corners may be swapped. |
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.
* For positive {@link size}s, this refers to the upper left corner of the viewport, but during resizing, corners may be swapped. | |
* For positive {@link size}s, this refers to the upper left corner of the viewport, but after resizing, corners may be swapped. |
Same argument as with the simulated regions.
* | ||
* @deprecated Do not access directly, use helper methods from models/utils/position/position-helpers(-mutable) instead. | ||
*/ | ||
@ValidateNested() | ||
@IsPosition() | ||
public readonly position: Position; | ||
|
||
/** | ||
* Size of the viewport. | ||
* The width of a viewport grows to the left, the height grows downwards. |
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.
* The width of a viewport grows to the left, the height grows downwards. | |
* The width of a viewport grows to the right, the height grows downwards. |
Or am I wrong again?
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.
No, should be correct (your suggestion, not the current version).
There are still multiple occurrences of I also believe the To fix this, I propose to change the position of a I would offer to do this migration sometime in the next week. |
Sounds good, thank you! So we can close this PR as it will be obsolete after your changes anyway. |
In #663 we've fixed a bug related to the position and size of viewports and simulated regions. To prevent similar bugs to occur again, this PR should improve the documentation of these values.