JuliaGraphics / Luxor.jl

Simple drawings using vector graphics; Cairo "for tourists!"
http://juliagraphics.github.io/Luxor.jl/
Other
576 stars 72 forks source link

multi drawings complete (somehow) #237

Closed oheil closed 1 year ago

codecov[bot] commented 1 year ago

Codecov Report

Merging #237 (72e532f) into master (600ab38) will increase coverage by 0.07%. The diff coverage is 90.74%.

@@            Coverage Diff             @@
##           master     #237      +/-   ##
==========================================
+ Coverage   73.58%   73.65%   +0.07%     
==========================================
  Files          32       32              
  Lines        6185     6203      +18     
==========================================
+ Hits         4551     4569      +18     
  Misses       1634     1634              
Impacted Files Coverage Ξ”
src/drawings.jl 66.12% <90.74%> (+2.65%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data Powered by Codecov. Last update 600ab38...72e532f. Read the comment docs.

guo-yong-zhi commented 1 year ago

Is this PR related to https://github.com/JuliaGraphics/Luxor.jl/issues/117?

oheil commented 1 year ago

No. Using threads and checking issues with it is next on my agenda... It is completing this https://github.com/JuliaGraphics/Luxor.jl/pull/236

cormullion commented 1 year ago

Perhaps some of these functions would be better named as ...index() and ...indices() since they return or set index values rather than drawing objects?

One day we might have named drawings (an extra field in the struct perhaps?) rather than these old-school numbers... πŸ™‚

oheil commented 1 year ago

Actually they were named ...index ;-) and I found ...drawing better. But no problem, I will change back to index. And the named drawings I also thought already about, but thought, this is something for another time. One step per step :-)

cormullion commented 1 year ago

With multiple dispatch you could have drawing_index() for get and drawing_index(n) for set... Anyway, It can be done how you like.

oheil commented 1 year ago

Yes, of course, as you wish. There is not much like or dislike in me regarding those things. But perhaps you want it like the other geters and seters, e.g. get_current_redvalue() , set_current_redvalue(r), ...

oheil commented 1 year ago

1) get_indices() get_current_index() set_current_index(i::Int) get_next_index() set_next_index()

2) drawing_indices() drawing_index() drawing_index(i::Int) get_next_drawing_index() set_next_drawing_index()

or something else?

cormullion commented 1 year ago

Probably

drawing_indices()
get_drawing_index()
set_drawing_index()
get_next_drawing_index()
set_next_drawing_index()

are the most explicit, consistent, and predictable names. Longer but more self-explanatory...?

oheil commented 1 year ago

Yes, that's how it should be then πŸ‘

cormullion commented 1 year ago

Thanks! Let's see how it works... :)