Skip to content

Fix double rotation of macro circle/line center coordinates (#233)#3

Merged
rampageservices merged 1 commit intodevelopfrom
fix/macro-double-rotation
Mar 6, 2026
Merged

Fix double rotation of macro circle/line center coordinates (#233)#3
rampageservices merged 1 commit intodevelopfrom
fix/macro-double-rotation

Conversation

@rampageservices
Copy link
Copy Markdown

Summary

  • Remove redundant gerbv_rotate_coord() calls for CIRCLE, LINE21, and LINE22 macro primitives in gerb_image.c
  • The rotation parameter update alone is sufficient — gerbv_rotate_coord() was double-applying the rotation

Upstream PR: gerbv#310
Fixes gerbv#233

The rendering code (draw.c) applies cairo_rotate() before
cairo_translate() for CIRCLE, LINE21, and LINE22 macro primitives,
meaning the rotation parameter already rotates the center coordinates
as part of the Cairo transformation.

The image copy/transform code (gerb_image.c) was updating the rotation
parameter AND calling gerbv_rotate_coord() on the center coordinates.
When the exported file was re-loaded, the center was rotated twice:
once by the pre-rotated coordinates, and again by cairo_rotate().

Remove the redundant gerbv_rotate_coord() calls for CIRCLE and
LINE21/LINE22, matching the pattern already used by LINE20, POLYGON,
MOIRE, and THERMAL — all of which correctly rely on the rotation
parameter alone.

Fixes gerbv#233
@rampageservices rampageservices force-pushed the develop branch 3 times, most recently from 180c677 to 49d1676 Compare March 3, 2026 03:42
@rampageservices rampageservices merged commit f2dcf5f into develop Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rotate macro_line tiwce when export image to rs274x

1 participant