Change coordinate system #4

Closed
opened 2022-09-24 17:11:11 +00:00 by mars · 3 comments
Owner

The current coordinate system is:

  • (0, 0) at the middle of the panel
  • X goes right, Y goes up
  • (-1, -1) and (1, 1) are the corner bounds

This sucks! HTML, for example, is Y-down for a reason. Coding UIs that read top-to-bottom is easier when Y increases downwards. Coordinates should also be guaranteed to be square.

Change the coordinate system and all existing UI code to:

  • (0, 0) at the top-left
  • X goes right, Y goes down
  • use logical points for scaling

I don't know how logical points are going to work. It depends on DPI scaling and what VR is expected to use. Perhaps Canary's core library doesn't need to care.

EDIT: it has been decided that Canary's unit measurement is the millimeter.

The current coordinate system is: - (0, 0) at the middle of the panel - X goes right, Y goes up - (-1, -1) and (1, 1) are the corner bounds This sucks! HTML, for example, is Y-down for a reason. Coding UIs that read top-to-bottom is easier when Y increases downwards. Coordinates should also be guaranteed to be square. Change the coordinate system and all existing UI code to: - (0, 0) at the top-left - X goes right, Y goes down - use logical points for scaling I don't know how logical points are going to work. It depends on DPI scaling and what VR is expected to use. Perhaps Canary's core library doesn't need to care. EDIT: it has been decided that Canary's unit measurement is the millimeter.
mars added this to the Launch milestone 2022-09-24 17:11:11 +00:00
mars self-assigned this 2022-09-24 17:21:54 +00:00
mars added a new dependency 2022-09-27 17:59:45 +00:00
Author
Owner

Magpie and the text rendering internals are updated to use the new coordinate system, but the sandbox and the SAO script are not. They need updating as soon as possible.

23d699dfef

Magpie and the text rendering internals are updated to use the new coordinate system, but the sandbox and the SAO script are not. They need updating as soon as possible. 23d699dfef
Author
Owner

canary-script and canary-types both use bl and tr for Rect coordinates, but because the Y axis is inverted, all Rects will need to use tl and br instead.

`canary-script` and `canary-types` both use `bl` and `tr` for `Rect` coordinates, but because the Y axis is inverted, all `Rect`s will need to use `tl` and `br` instead.
mars added the
feature
consistency
api change
labels 2022-11-01 06:27:29 +00:00
Author
Owner

Moved the work left to issues #28 and #29.

Moved the work left to issues #28 and #29.
mars closed this issue 2022-11-03 04:45:28 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Blocks
Reference: canary/canary-rs#4
No description provided.