Comments (12)
Awesome! For the record, I think this worked for me:
function Base.:-(num::Number, p::Point)
return Point(num - p.x, num - p.y)
end
function Base.:-(p1::Point, num::Number)
return Point(p1.x - num, p1.y - num)
end
from luxor.jl.
It would be a breaking change.
from luxor.jl.
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 ... 🤔
from luxor.jl.
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 😀
from luxor.jl.
Thanks for the kind words! I might have fixed this now (on master)... 🤞
Hoping to make another release this week...
from luxor.jl.
I think I might just have copy-pasted too carelessly back when I wrote this bit... :)
from luxor.jl.
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
from luxor.jl.
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!
from luxor.jl.
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.
from luxor.jl.
Is it reasonable to have a method like +(::Point, ::Number)
?
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 .+
operator.
julia> Point(1,2) .+ 1
Point(2.0, 3.0)
julia> [1,2] .+ 1
2-element Vector{Int64}:
2
3
from luxor.jl.
Yeah, should we release the breaking change? If so, I can open a PR to deprecate the methods.
from luxor.jl.
I was planning to release 3.x with deprecated methods (e.g. +(::Point, ::Number)
), and then release 4.0 with removing the deprecated methods. However, we have other reasons for the next breaking release, so it would be okay not to release the next 3.x. 🤔
from luxor.jl.
Related Issues (20)
- Parsing some largish svgs currently crash HOT 4
- Regression in opacity/hue settings in master? HOT 4
- User testing before release HOT 2
- Suggestions for improvements to documentation? HOT 1
- Choose drawing size after placing contents? HOT 6
- Release 3.7.0 HOT 2
- How can I recolor a graphic? HOT 2
- threadid() and nthreads() usage HOT 2
- Some fonts only render in specfic sizes, even when loaded from svg and saved as-is HOT 6
- rotated `placeimage` broken HOT 2
- Small circles does not have enough precision HOT 5
- Release 3.8.0 HOT 2
- MethodError: objects of type String are not callable HOT 3
- Update sethue() and setcolor() to accept Nothing arguement HOT 2
- Source code for how to create a graph for inclusion in Luxor Documentation HOT 7
- Drop dependencies like FFMPEG (in the long run)? HOT 6
- You can't just "Plot a pixel on the screen" HOT 3
- Remove dependency on Juno.jl HOT 3
- SVG with transparent background HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from luxor.jl.