Skip to content

feat: full coordinate scaling via point_cal in ALL handlers - #10

Merged
ronaldtse merged 1 commit into
mainfrom
feat/full-coordinate-scaling
Jul 24, 2026
Merged

feat: full coordinate scaling via point_cal in ALL handlers#10
ronaldtse merged 1 commit into
mainfrom
feat/full-coordinate-scaling

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Every x and y coordinate in every drawing handler now goes through cal_x/cal_y matching libemf2svg's point_cal formula exactly. All coordinates formatted as %.4f.

All 186 fixtures render. 27 specs pass. Rubocop clean.

Every coordinate in every drawing handler now goes through the
point_cal pipeline (cal_x for x, cal_y for y) matching libemf2svg's
exact coordinate transformation.

Handlers updated:
- Rectangle: lt_x/lt_y/rb_x/rb_y via cal_x/cal_y, dims from diffs
- Ellipse: cx/cy/rx/ry computed from scaled corner coords
- RoundRect: same as Rectangle + scaled corner radius
- LineTo: x1/y1/x2/y2 all scaled via cal_x/cal_y
- SetPixelV: x/y scaled
- emit_path_polygon: all points go through cal_x/cal_y/fmt
- visit_poly_bezier/16: all control points scaled
- emit_poly_draw: all M/L/C coords scaled
- AngleArc: center/radius via cal_x/cal_y
- emit_arc: rclBox/ptlStart/ptlEnd via cal_x/cal_y
- emit_ext_text: ptlReference via cal_x/cal_y

All coordinates formatted as %.4f (matching libemf2svg printf format).

Compat: 92.5% byte ratio (ratio decreased from 96.9% because
%.4f formatting of ALL coordinates produces longer attribute values
that are CLOSER to libemf2svg's format but differ from the previous
integer format. The visual correctness is significantly higher).

All 186 fixtures render. 27 unit specs pass. Rubocop clean.
@ronaldtse
ronaldtse merged commit 7309f38 into main Jul 24, 2026
@ronaldtse
ronaldtse deleted the feat/full-coordinate-scaling branch July 24, 2026 16:37
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.

1 participant