Icon Renderer
MID Multi Planes Overview
Single Item Selection
Solution #1: Point inside the part’s bounding box
ItemPartIterator parts = Item.getItemParts();
ItemPart part = null;
While (parts.asMore()) {
part = (ItemPart) parts.next();
(p1.x >= part.x) && (p1.x <= part.x+ part.width) &&
(p1.y >= part.y) && (p1.y <= part.y+ part.height)
} ;
Solution #2: Using OpenGL(hardware acceleration) to draw each item with a specific color and read back the mouse position on the frame-buffer. Viewport could be 3x3 pixels and mouse pointer at 1,1
MIDView Multi-Selection Overview
ViewItem and ItemParts coordinate systems Overview
item anchor :: a(0,0) = v(x,y)
item icon :: i(0,0) = a(0,0)
item text :: t(0,0) = ( ( a - ( text.width/2)) + (icon.width/2) ) , (a + icon.height) )