Skip to content
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

Documentation/Functionality Error for scene-line #81

Open
manaskor opened this issue Oct 19, 2023 · 3 comments
Open

Documentation/Functionality Error for scene-line #81

manaskor opened this issue Oct 19, 2023 · 3 comments

Comments

@manaskor
Copy link

https://pyret.org/docs/latest/image.html#%28part._image_scene-line%29

scene-line :: (
img :: Image,
x1 :: Number,
y1 :: Number,
x2 :: Number,
y2 :: Number,
background :: Image
)
-> Image
Draws a line from (x1,y1) to (x2,y2) on the scene background. Unlike add-line, this function crops the resulting image to be the same size as background.

But the background parameter should instead refer to a parameter of type ImageColor, as seen below for add-line:

https://pyret.org/docs/latest/image.html#%28part._image_add-line%29

add-line :: (
img :: Image,
x1 :: Number,
y1 :: Number,
x2 :: Number,
y2 :: Number,
color :: ImageColor
)
-> Image
Creates a new image like img with a line added starting from the point (x1,y1) and going to the point (x2,y2). Unlike scene-line, if the line passes outside of img, the image gets larger to accommodate the line.

Additionally, scene-line adds a small black border around the resultant image, which is not a stated feature of either scene-line, add-line, or crop.

@blerner blerner transferred this issue from brownplt/pyret-lang Apr 30, 2024
@blerner
Copy link
Member

blerner commented Apr 30, 2024

Additionally, scene-line adds a small black border around the resultant image, which is not a stated feature of either scene-line, add-line, or crop.

This is not quite the right interpretation of what you're seeing. "Scenes" have borders around them, for example empty-scene(40, 20) produces
image
But you're right that the image in the docs doesn't show that border, for some reason. @schanzer @shriram we should harmonize these somewhat: when do we really want Scenes to have borders on them? We don't appear to be consistent about this at all.

As for the signature error, I'll push a fix in a moment.

@blerner blerner reopened this Apr 30, 2024
@schanzer
Copy link

schanzer commented May 1, 2024

@blerner my understanding of empty-scene is that it always adds a border. So unless I've been using it incorrectly for the last 19 years, I think the image in the docs is just wrong!

@blerner
Copy link
Member

blerner commented May 1, 2024

Yes, but there are a bunch of calls to makeSceneImage with false for the border parameter. I.e. we make a bunch of "scenes" in the data sense but not in the scenic sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants