hey guys
when i create my sharedwhiteboard im scaling it to the size of an image behind it. if you look at either of the attached imgs you'll see a green patterned image behind a whiteboard (whiteboard with alpha set to 0.5 so we can see both objects). as you can see, the image and the whiteboard have identical sizes and metrics, all good.
however, if you take a look at whiteBoard_1.jpg you'll see that a whiteboard line that was started inside/on the whiteboard is being drawn outside of the whiteBoard area. this looks like a masking issue because as soon as you lift the mouse the line gets masked/cropped/whatever to the given whiteboard/image area.
then take a look at whiteBoard_2.jpg. you can see that the initial line that was outside the area has been correctly cropped and that a second line, drawn just below the first, draws and masks/crops/whatever correctly first time. and it doesn't matter whether the first, second or fifty-third whiteboard shape has gone over the edge: it is the first whiteboard shape to go over the edge that causes the mask to be applied. which is obviously a problem.
the question then: what can we do about this?
SharedWhiteBoard masking problemChanging the WhiteBoards width and height and zoom level might fix your problem.
sharedWhiteBoard.width = image.contentWidth;
sharedWhiteBoard.height = image.contentHeight;
sharedWhiteBoard.zoomLevel = image.contentWidth/originalImageWidth;
sharedWhiteBoard.invalidateDisplayList();
where originalImageWidth is the actual width when the image is loaded. Let me know if this solution works for you.
Thanks
SharedWhiteBoard masking problemAlso can you verify if the scenario you mentioned happens all the time, or just the first time you draw something.
Thanks
No comments:
Post a Comment