SFML community forums
Help => Graphics => Topic started by: emlai on July 21, 2016, 02:25:20 pm
-
sf::Image::copy allows the images to overlap like this (red is the target image, green is the source image):
(http://i.imgur.com/cCmiG2r.gif)
but not like this:
(http://i.imgur.com/0peJadC.gif)
I think this behavior is inconsistent. Is there a rationale for this or is this just an oversight?
-
Overlap where, when, what? Are you talking about source/destination rectangles here with your images? What is the red rectangle, what is the green rectangle?
-
What is the red rectangle, what is the green rectangle?
Please read the post.
-
Please read this (http://en.sfml-dev.org/forums/index.php?topic=5559.0).
-
The right/bottom tests are implemented here (https://github.com/SFML/SFML/blob/master/src/SFML/Graphics/Image.cpp#L214-L215). Seems like left/top would just need a similar test to make your second example work.
-
Seems like left/top would just need a similar test to make your second example work.
In addition to that the destX and destY parameters would need to be int, rather than unsigned int.
-
since x_y coords in c++ goes like this:
--->
|
v
your first image shows the green image being added at a positive X and y coordinate on the red image
but the second shows it being added at a negative coordinate. said coordinate could be out of bounds for the image. (eg, you are trying to draw outside of the paper)
just my thoughts....