-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Base Subtract operator between Luxor.Point and a Number is incorrect #270
Comments
I’m not sure what it’s even supposed to do 😂 Probably this needs to be looked at Line 28 in d7c261e
Cairo doesn’t know about Points 😀 |
Thanks for the kind words! I might have fixed this now (on master)... 🤞 Hoping to make another release this week... |
Awesome! For the record, I think this worked for me:
|
I think I might just have copy-pasted too carelessly back when I wrote this bit... :) |
Haha yeah I just saw it. Btw this wrapper is pretty much perfect for generative art. I've gotten good results really quickly with it. I hope to make an article guide about it soon :D |
Looking forward to that! It’s mostly designed for that kind of use - parameterized graphic design and similar - so I’m happy that you’re getting some results you like! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Is it reasonable to have a method like julia> using Luxor
julia> Point(1,2) + 1
Point(2.0, 3.0)
julia> [1,2] + 1
ERROR: MethodError: no method matching +(::Vector{Int64}, ::Int64)
For element-wise addition, use broadcasting with dot syntax: array .+ scalar I think it would be enough with julia> Point(1,2) .+ 1
Point(2.0, 3.0)
julia> [1,2] .+ 1
2-element Vector{Int64}:
2
3 |
It would be a breaking change. |
Yeah, should we release the breaking change? If so, I can open a PR to deprecate the methods. |
Perhaps the next version of Luxor should be version 4.0, with some breaking changes, supporting only Julia 1.9 and above (thanks to package extensions). It might be good to wait until Julia 1.10 is released first before releasing 4.0 ... 🤔 |
I was planning to release 3.x with deprecated methods (e.g. |
When doing a simple math operation between a Point and a Number such as
Point(1,1)+10
gets a correct answer. However, subtraction such as10-Point(1,1)
getsPoint(-9.0, -9.0)
. It's worth noting that-Point(1,1)+10 =>Point(9.0, 9.0)
and10+-Point(1,1)=>Point(9.0, 9.0)
. It's only the case ofNumber-Point
that it fails. I couldn't find the Point type in Cair so I'm not sure where this issue is rooted. I'm really loving the package btw great job! :DThe text was updated successfully, but these errors were encountered: