/**
* @see net.rim.device.api.openvg.VGField#render(VG)
*/
protected void render(final VG renderer) {
final VG11 vg11 = (VG11) renderer;
// Clear the display from the last time it was rendered
vg11.vgClear(0, 0, getWidth(), getHeight());
// Draw the text images on this field
drawText(vg11);
// Set VG_MATRIX_MODE to VG_MATRIX_PATH_USER_TO_SURFACE
vg11.vgSeti(VG10.VG_MATRIX_MODE, VG10.VG_MATRIX_PATH_USER_TO_SURFACE);
// Load a clean identity matrix
vg11.vgLoadIdentity();
// Calculate scale factor
final float scaleFactor =
Math.min(_displayHeight / PATHS_IMAGE_HEIGHT, _displayWidth
/ PATHS_IMAGE_WIDTH);
// Calculate x position
final float xPos =
(_displayWidth - PATHS_IMAGE_WIDTH * scaleFactor) / 2;
// Move the y position to just below the text that was drawn
final int yPos = _displayHeight - (TEXT_OFFSET + 5);
// Translate to origin corresponding to SVG (top left)
vg11.vgTranslate(xPos, yPos);
// Scale the image
vg11.vgScale(scaleFactor, -scaleFactor);
// Draw the image on the screen
drawPaths(vg11, _svgPathsArray);
}