DrawNormal is ignoring the offset.

Jul 24, 2013 at 6:57 PM
Edited Jul 24, 2013 at 6:58 PM
Hi everyone,
Im trying to take a piece of my map and render it to a designed position in the window.

Im doing this at layer level using the Layer.Draw method:
public void Draw(IDisplayDevice displayDevice, Rectangle mapViewport, Location displayOffset, bool wrapAround);
Now Im able to select the area of the map I want to render by specifying the mapViewport rectangle, and my intention is tp specify the destination of the render in my screen by using the displayOffset. But when I set wrapAround as false, the displayOffset is just ignored.
If wrapAround is true, the offset works, but I dont really want to use wrapping.

I have taken a look into the code, and seems that the method DrawNormal is just ignoring the displayOffset parameter.


Is this the normal behavior, or am I using it in a wrong way?
Jul 25, 2013 at 11:56 AM
Edited Jul 25, 2013 at 2:16 PM
You're right, and I'm quite surprised this has gone unnoticed for such a long time, or at least since the implementation of wrapAround. I'll look into it.. seems like I'm due for a release anyway :)

EDIT: I have implemented a fix in source code but I have not built a new release yet. In the meantime you can grab the code and compile it. No application code should be broken except for anyone who has written an implementation of the IDisplayDevice interface to work with something other than XNA.
Jul 25, 2013 at 3:22 PM
Great! I was going crazy with this bug.
Thanks for your quick feedback.
Jul 25, 2013 at 4:07 PM
The viewport clipping for the XNA implementation of IDisplayDevice was not really working but most users seem to render to the whole display which didn't bring up this issue. Glad to see it working now and also to have been of help :)
I will release a new update soon.