io7m | single-page | multi-page | JSycamore User Manual
2.7. Themes
Previous
2. Model
Up
2.9. Rendering
Next

# 2.8. Coordinate Systems

- 2.8.1. Overview
- 2.8.2. Component-Relative Space
- 2.8.3. Parent-Relative Space
- 2.8.4. RGBAPre Space
- 2.8.5. Text-Aligned Space
- 2.8.6. Viewport Space
- 2.8.7. Window Space

## 2.8.1. Overview

1
The jsycamore package defines numerous coordinate systems. All 2D coordinate systems are defined such that the origin (0, 0) represents the top left point of the coordinate system, with the X axis pointing rightwards towards positive infinity, and the Y axis pointing downwards towards positive infinity.

### 2.8.1.2. Coordinates

3
Positions in an N-dimensional coordinate system S with components of type T in jsycamore are defined as values of immutable vectors of type PVectorNT<S>. The phantom-type parameter S on the vector type statically prevents users of the package from mixing up coordinates in different coordinate systems and getting unexpected results. As a concrete example, the parent-relative space is a two-dimensional coordinate system with integer component values, and therefore positions in this coordinate system are given as values of type PVector2I<SySpaceParentRelativeType>.
4
The following sections describe the coordinate spaces currently defined by the jsycamore package.

## 2.8.2. Component-Relative Space

1
The component-relative space is a two-dimensional integer coordinate system where the origin (0, 0) represents the top-left corner of a component.
2
This coordinate space is primarily used by themes to produce render nodes.

## 2.8.3. Parent-Relative Space

1
The parent-relative space is a two-dimensional integer coordinate system where the origin (0, 0) represents the top-left corner of a parent component.
2
The positions of all components are specified in this space.

## 2.8.4. RGBAPre Space

1
The rgba-pre space is a four-dimensional real coordinate system describing linear, alpha-premultiplied colours. For example, a pure opaque black colour is represented by the point (0,0,0,1).

## 2.8.5. Text-Aligned Space

1
The text-aligned space is a two-dimensional integer coordinate system used to address text. It takes into account the alignment applied to text for left-to-right and right-to-left text.

## 2.8.6. Viewport Space

1
The viewport space is a two-dimensional integer coordinate system where the origin (0, 0) represents the top-left corner of a screen.

## 2.8.7. Window Space

1
The window space is a two-dimensional integer coordinate system where the origin (0, 0) represents the top-left corner of a window.
2.7. Themes
Previous
2. Model
Up
2.9. Rendering
Next
io7m | single-page | multi-page | JSycamore User Manual