Rasterific icon indicating copy to clipboard operation
Rasterific copied to clipboard

Render with relative anchor

Open SwiftsNamesake opened this issue 8 years ago • 1 comments

I wonder if it'd be possible to add some kind of withAnchor function. For example, if you want to render centred text at a point p, you would do withAnchor (V2 0.5 0.5) p $ ... or something similar. In other words, the coordinates are relative to the bounding box of the thing being rendered and are normalised with respect to it.

It would also be useful if you wanted to position elements relative to each other (eg. so that they're adjacent to each other).

I'm already aware of PlaneBoundable but there's no instance for text it seems. Also, withTransformation simply transforms the coordinates with the given matrix, right?

Maybe this functionality is already available (or easy to emulate), but if so I haven't found it.

SwiftsNamesake avatar Aug 21 '17 18:08 SwiftsNamesake

It should be doable while working with some bounding box, but it should appear "late" in the pipeline (once geometry is fully transformed). The thing is, by creating a withAnchor, I'm not sure it's possible to export it to pdf

Twinside avatar Aug 25 '17 13:08 Twinside