-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
JImage
Implementation for J-Objects
#399
Open
TheCedarPrince
wants to merge
24
commits into
main
Choose a base branch
from
tcp-image-jobjects
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
8f62037
Exported the JImage function from the JImage shorthand
TheCedarPrince f1e0822
Possible implementation of adding an image easily to JObjects
TheCedarPrince e1f5cd8
Made argument names less confusing
TheCedarPrince de8f54f
Merge branch 'master' into tcp-image-jobjects
TheCedarPrince 7ffc1ba
Added scaling capabilities
TheCedarPrince e908f6d
Added docstring, changed default for shape
TheCedarPrince da0184c
In process of adding tests for JImage
TheCedarPrince 1ac4713
Merge branch 'master' into tcp-image-jobjects
TheCedarPrince c891118
Added type signature from Cairo
TheCedarPrince 27620ba
Reference image for JImage
TheCedarPrince 80957f1
Fixed docstrings
TheCedarPrince 6017adc
Revised using dispatch image
TheCedarPrince 10c9686
Merge branch 'master' into tcp-image-jobjects
TheCedarPrince 68a452a
Added TODO for scaling logic
TheCedarPrince 36bbcbd
Temporary disabling of tests
TheCedarPrince 5811f1a
Added TODO for tests, fixed test cases, and fixed references
TheCedarPrince 2debc17
Added individual tests; working on scaling
TheCedarPrince 545268c
Begin adding autoscaling support for JImage
TheCedarPrince 80ca14e
Added image support dispatch for JBox
TheCedarPrince 92f36ca
Added image support dispatch for JPoly
TheCedarPrince 6e91da7
Added image support dispatch for JStar
TheCedarPrince 2c18b27
Added image support dispatch for JRect
TheCedarPrince d6331a2
Added image support dispatch for JCircle
TheCedarPrince 51dde2c
Added image support dispatch for JEllipse
TheCedarPrince File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
function _JImage(pos, img, centering, shapeargs, shape) | ||
if shape != false | ||
shape(shapeargs...) | ||
end | ||
placeimage(img, pos, centered = centering) | ||
TheCedarPrince marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return pos | ||
end | ||
|
||
JImage(pos::Point, img, centering = true; shapeargs = (), shape = false) = | ||
( | ||
args...; | ||
pos = pos, | ||
img = img, | ||
centering = centering, | ||
shapeargs = shapeargs, | ||
shape = shape, | ||
) -> _JImage(pos, img, centering, shapeargs, shape) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor thing:
I think we should mention(in the docstring) that
shape
should be a valid Luxor shape(a luxor function).eg: rect, box, poly etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"valid Luxor shape" I'm not aware of this concept. :) Do you mean a built-in Luxor function - eg one that constructs paths, or one that generates points for polygons...? (Not trying to be awkward, just I get worried in case I'm not providing the tools you folks need for your cool constructions!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah! We need shape to be a valid luxor function. Since a user may interpret it as entering a full shape name eg: rectangle instead of
rect
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We mean any kind of function either their own or more likely a Luxor drawing function. Mostly those which provide the clipping action (so yeah a drawing function 😂)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, yes. Perhaps any function that has an
action
parameter/keyword...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing I want to mention is that
shape
should by typed toMethod
.eg: If there's a variable
circle = Object(...)
, and user passes circle as an argument, it will throw theObjects of type Javis.Object are not callable
error and maybe use a try catch block to give out a better error message?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea - error handling is something we need to reckon with @Sov-trotter . I agree with your thoughts and will see what I can do.