Skip to main content

Icon Renderer

MID Multi Planes Overview

image-1581290393685.png

 

Single Item Selection

image-1581290402062.png

 

 

 

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

image-1581290410478.png

 

ViewItem and ItemParts coordinate systems Overview

image-1581290420979.png

 

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) )