Skip to content

Commit 0000000

Browse files
committed
fix offset handling in textwithbox
1 parent 301371d commit 0000000

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/recipes/textwithbox.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ function Makie.plot!(p::TextWithBox)
1717
# solution by Julius Krumbiegel (jkrumbiegel) on slack
1818
scene = Makie.get_scene(p)
1919
glyphcolls = t.plots[1][1]
20-
bboxes = lift(glyphcolls, scene.camera.projectionview, scene.viewport, padding) do glyphcolls, _, _, padding
20+
bboxes = lift(glyphcolls, scene.camera.projectionview, scene.viewport, padding, tattrs.offset) do glyphcolls, _, _, padding, offset
2121
transformed = Makie.apply_transform(t.transformation.transform_func[], t[1][])
2222
pos = Makie.project.(Ref(scene.camera), t.space[], t.markerspace[], transformed)
2323

2424
map(glyphcolls, pos) do glyphcoll, pos
2525
rect = Rect2f(Makie.unchecked_boundingbox(glyphcoll, pos, Makie.to_rotation(t.rotation[])))
26+
@reset rect.origin .+= offset
2627
isnothing(padding) ? rect : dilate(rect, padding)
2728
end
2829
end

0 commit comments

Comments
 (0)