Warning: session_start(): open(/var/lib/php/sessions/sess_cs8322k7o185r11obb7qihb9tc, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
sclass ImageSurface_HighlightRegion > ImageSurfaceMouseHandler is G2Drawable {
FastRegions_BWImage regions;
int iHighlightedRegion;
Pt lastPt;
int lineWidth = 3;
*(ImageSurface is) {
if (containsInstance(is.tools, getClass())) ret;
register(is);
is.overlays.add(this);
}
public void close :: after {
is.overlays.remove(this);
}
public void mouseMoved(MouseEvent e) {
lastPt = getPt(e);
update();
}
// TODO: enter, exit
int newRegion() {
if (lastPt == null || regions == null) ret 0;
ret regions.regionAt(lastPt.x, lastPt.y);
}
void update {
int r = newRegion();
if (iHighlightedRegion != r) {
iHighlightedRegion = r;
is.repaint();
}
}
void setRegions(FastRegions_BWImage regions) {
this.regions = regions;
iHighlightedRegion = -abs(iHighlightedRegion);
update();
}
public void drawOn(Graphics2D g) {
if (iHighlightedRegion == 0) ret;
Rect r = regions.regionBounds(iHighlightedRegion);
g.setColor(withOpacity(.3, Color.red));
temp tempSetStroke(g, new BasicStroke(lineWidth));
drawRect(g, growRectTopAndLeft(scaleRect_floor(growRectRightAndBottom(r), is.getZoomX(), is.getZoomY())));
}
}