Closed ruuda closed 6 years ago
offset
for the top-left corner has been implemented in f16b36f2cb9b961495002603028999429a1be68e.
This has been implemented, although I am not entirely sure whether the current system with a size
, offset
, and anchor
is what I really want. But at least for now it works well enough.
Currently it is impossible to write a correct
center
function in Pris. The following has the wrong offset when the top-left corner of the bounding box does not coincide with the origin of a frame:The correct version would be:
where
top_left
is the offset of the top-left corner of the bounding box, to the origin. As the origin is always included in the bounding box (should it be?), this offset is either negative or zero.Bikeshed: what is a good intuitive name for this?
top_left
?offset
? The following fields also exist currently:width
: width of the bounding box.height
: height of the bounding box.size
: (width, height) of the bounding box.anchor
: offset relative to the origin of the frame, where new frames can be adjoined. (Not yet implemented.)