Skip to content

Fix missing rotation for circle primitives in GDK renderer#375

Merged
spe-ciellt merged 1 commit intogerbv:developfrom
SourceParts:fix/gdk-macro-circle-rotation
Mar 7, 2026
Merged

Fix missing rotation for circle primitives in GDK renderer#375
spe-ciellt merged 1 commit intogerbv:developfrom
SourceParts:fix/gdk-macro-circle-rotation

Conversation

@rampageservices
Copy link
Copy Markdown
Contributor

Summary

Test plan

  • Load the test case from Incorrect display of rotated circle in aperture macro #352 (1,1,2.59,2,5,19.5 — circle at center 2,5 with 19.5° rotation)
  • Switch between Fast (GDK) and Normal (Cairo) rendering — both should now show the circle in the same position on the edge of the square
  • Verify selection target matches the rendered position

gerbv_gdk_draw_prim1 was the only GDK macro primitive handler that
did not apply rotation to its center coordinates. Before gerbv#310, this
was masked because gerb_image.c pre-rotated the center via
gerbv_rotate_coord(). Removing that pre-rotation (correctly, to fix
the Cairo double-rotation bug) exposed that the GDK renderer never
had its own rotation handling for circles.

Apply rotate_point() to the center offset before translating, matching
the pattern used by all other GDK macro primitives (prim4, prim5,
prim6, prim7, prim20, prim21, prim22).

Fixes gerbv#352
@spe-ciellt spe-ciellt added the fix Solution for a potential problem or omission. label Mar 7, 2026
@spe-ciellt
Copy link
Copy Markdown
Contributor

I tested it and all renderers render it correctly. Good work!

@spe-ciellt spe-ciellt merged commit f98e039 into gerbv:develop Mar 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Solution for a potential problem or omission.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants