drawIcon method
Draws a registered icon (iconKey) into the given square, or returns
false so the caller can render a placeholder glyph. When disabled is
true the implementation should apply a ~40% alpha (Xojo Transparency).
Implementation
@override
bool drawIcon(
String iconKey,
double x,
double y,
double size, {
bool disabled = false,
}) {
final img = _IconImageCache.get(iconKey);
if (img == null || !_IconImageCache.isLoaded(iconKey)) return false;
if (disabled) ctx.globalAlpha = 0.4;
ctx.drawImage(img, x, y, size, size);
if (disabled) ctx.globalAlpha = 1.0;
return true;
}