Hi Folks,
if my problem is simple to solve, you don´t have to read further after this question:
Some of the points of my Line2D are outside it´s DrawArea. You could take a look at the attachment.
1. Is this a bug?
2. Why are this parts of Line2D won´t be cut of at the borders of the DrawArea?
Here´s my whole story, if anyone is bored ;)
I´m creating reusable UI-Components and some of them have a fix pixelsize instead of a fix ratio to the screensize.
(btw. my components with fix aspectratio are working correctly)
My placeable UI-container, inherits from the Control-class.
When resizing the window, my UI-Host(Entity) forwards the command to its containers (Control), and the containers resizes their components/childs (most of them are Entity2D) directly or indirectly.
In this example case for troubleshooting, I got following structure:
UI-Host -> 1 Sidebar (Control) on the rightside, 200px width -> 1 Line2D (the border of the sidebar)
The Line2D is extended with the ExtendedLine()-Method to a rectangle. Start-/Endpoint is the topleft-point of its container.
A short overview of the values:
At start:
Window-ViewportPixelsize: 1280/720px
ScreenSpace: RelativeScreenSpace
Sidebar-size: 200px (=1,5625) /1.0f
Sidebar-TopLeft: 0,84375 (=1280-200px) / 0.0f
Border.Start/-EndPoint (TopLeft):
0,84375 / 0.0f (Border.DrawArea is identical)
After maximizing my window, I recalculate the DrawAreas of all UI-components.
Window-ViewportPixelsize: 1600/900px
ScreenSpace: RelativeScreenSpace
Sidebar-size: 200px (=0,125)/1.0f
Sidebar-TopLeft: 0,875 (=1600-200px) / 0.0f
Border.Start/-Endpoint (TopLeft):
0,84375 / 0.0F (Didn´t changed,
whereas the DrawArea of the Line2D changed to 0,875)
EDIT: On resizing, I changed the DrawArea of the Line2D with following code:
Code:Get<Line2D>().DrawArea = DrawArea; // DrawArea belongs to the container
So the point array has got drawn elements, which are outside of it´s DrawArea, and were not updated to the new DrawArea.
Greetings
Edited by user Saturday, November 9, 2013 3:55:04 PM(UTC)
| Reason: Set markers on the important values
ollimorp attached the following image(s):

DrawArea.png
(22kb) downloaded 11 time(s).You cannot view/download attachments. Try to login or register.