added relative x coordinates

This commit is contained in:
2024-05-17 00:11:04 +02:00
parent 6174baf650
commit ef4461bd18
5 changed files with 326 additions and 7 deletions

View File

@ -39,12 +39,20 @@
let width = w
let height = h
let x = x
let y = y
if x == none { panic("Parameter x must be set") }
if y == none { panic("Parameter y must be set") }
if w == none { panic("Parameter w must be set") }
if h == none { panic("Parameter h must be set") }
if (type(x) == dictionary) {
let offset = x.rel
let to = x.to
let (ctx, to-pos) = coordinate.resolve(ctx, (rel: (offset, 0), to: to))
x = to-pos.at(0)
}
if (type(y) == dictionary) {
let from = y.from
let to = y.to