Sudha247 / ocaml-joy

MIT License
21 stars 14 forks source link

Line width API: alternative API #128

Open nikochiko opened 4 months ago

nikochiko commented 4 months ago

Two suggestions:

  1. Rename line_width to thickness
  2. Replace set_line_width with a transformation
let s = rectangle 50 50 in
let thick_s = s |> scale 2 |> scale_thickness 1.5 in
show [s; thick_s]

This will also change how we handle Cairo backend. We don't eagerly render and carry a half rendered canvas in memory.

Instead, we only store a list of shapes (added by show) and then render it at once within write.

nikochiko commented 4 months ago

I am open to alternatives for scale_thickness (and also just thickness too).