renderer.setProgressUpdater(mainProgressUpdater);
flame.setSampleDensity(prefs.getTinaRenderPreviewQuality());
}
renderer.setRenderScale(renderScale);
long t0 = System.currentTimeMillis();
RenderedFlame res = renderer.renderFlame(info);
long t1 = System.currentTimeMillis();
SimpleImage img = res.getImage();
img.getBufferedImg().setAccelerationPriority(1.0f);
if (data.layerAppendBtn.isSelected() && !pMouseDown) {
TextTransformer txt = new TextTransformer();
txt.setText1("layer-append-mode active");
txt.setAntialiasing(true);
txt.setColor(Color.RED);
txt.setMode(Mode.NORMAL);
txt.setFontStyle(FontStyle.BOLD);
txt.setFontName("Arial");
txt.setFontSize(16);
txt.setHAlign(HAlignment.RIGHT);
txt.setVAlign(VAlignment.BOTTOM);
txt.transformImage(img);
}
if (data.layerPreviewBtn.isSelected()) {
Layer onlyVisibleLayer = null;
for (Layer layer : getCurrFlame().getLayers()) {
if (layer.isVisible()) {
if (onlyVisibleLayer == null) {
onlyVisibleLayer = layer;
}
else {
onlyVisibleLayer = null;
break;
}
}
}
boolean drawSubLayer = flame.getLayers().size() > 1 && getCurrLayer() != null && getCurrLayer() != onlyVisibleLayer && !cfg.isNoControls();
if (drawSubLayer) {
Flame singleLayerFlame = new Flame();
singleLayerFlame.assign(flame);
singleLayerFlame.getLayers().clear();
singleLayerFlame.getLayers().add(getCurrLayer().makeCopy());
singleLayerFlame.getFirstLayer().setVisible(true);
singleLayerFlame.getFirstLayer().setWeight(1.0);
RenderInfo lInfo = new RenderInfo(width / 4 * renderScale, height / 4 * renderScale, RenderMode.PREVIEW);
double lWScl = (double) lInfo.getImageWidth() / (double) singleLayerFlame.getWidth();
double lHScl = (double) lInfo.getImageHeight() / (double) singleLayerFlame.getHeight();
singleLayerFlame.setPixelsPerUnit((lWScl + lHScl) * 0.5 * singleLayerFlame.getPixelsPerUnit() * 0.5);
singleLayerFlame.setWidth(lInfo.getImageWidth());
singleLayerFlame.setHeight(lInfo.getImageHeight());
FlameRenderer lRenderer = new FlameRenderer(singleLayerFlame, prefs, false, false);
RenderedFlame lRes = lRenderer.renderFlame(lInfo);
SimpleImage layerImg = lRes.getImage();
boolean drawLayerNumber = true;
if (drawLayerNumber) {
RectangleTransformer rT = new RectangleTransformer();
int textWidth = 28;