JuliaGraphics / Luxor.jl

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

rect not working correct when using origin() #248

Closed oheil closed 1 year ago

oheil commented 1 year ago

Example:

using Luxor
d=Drawing(100, 100, "rect.pdf")
origin()
setcolor("blue")
rect(-49,-49,49,49;action=:fill)
finish()
preview()

Result: rect.pdf

Same result for .png, but because of transparency not so visible here.

julia> versioninfo()
Julia Version 1.8.2
Commit 36034abf26 (2022-09-29 15:21 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, haswell)
  Threads: 4 on 8 virtual cores
Environment:
  JULIA_PKGDIR = c:\Program Files\Julia-0.6.2\packages\
  JULIA_SHELL = C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

(@v1.8) pkg> st Luxor
Status `C:\Users\oheil\.julia\environments\v1.8\Project.toml`
  [ae8d54c2] Luxor v3.6.0
oheil commented 1 year ago

Sorry, confused width, height and origin coordinates.

cormullion commented 1 year ago

That reminds me, when I first started with Luxor I went for separate x and y arguments, then pretty soon switched over to Point arguments. It’s probably inconsistent still. Too disruptive to go through and remove the separate x and y argument versions though 😀