mirror of
https://github.com/igorski/bitmappery.git
synced 2026-07-09 08:45:45 +02:00
More appropriate calculation for rendering blended layer bitmaps
This commit is contained in:
@@ -36,6 +36,7 @@ import { LayerTypes } from "@/definitions/layer-types";
|
||||
import ToolTypes, { canDrawOnSelection, TOOL_SRC_MERGED } from "@/definitions/tool-types";
|
||||
import { scaleRectangle, rotateRectangle } from "@/math/rectangle-math";
|
||||
import { translatePointerRotation, rotatePointer } from "@/math/point-math";
|
||||
import { fastRound } from "@/math/unit-math";
|
||||
import { renderEffectsForLayer } from "@/services/render-service";
|
||||
import { getBlendContext, blendLayer, hasBlend } from "@/rendering/blending";
|
||||
import { clipContextToSelection } from "@/rendering/clipping";
|
||||
@@ -692,7 +693,11 @@ export default class LayerSprite extends ZoomableSprite {
|
||||
bitmap = createSyncSnapshot( document, getBlendableLayers());
|
||||
cacheBlendedLayer( layerIndex, bitmap );
|
||||
}
|
||||
documentContext.drawImage( bitmap, -viewport.left, -viewport.top, document.width, document.height );
|
||||
const pixelRatio = getPixelRatio();
|
||||
documentContext.drawImage(
|
||||
bitmap, -fastRound( viewport.left ), -fastRound( viewport.top ),
|
||||
fastRound( bitmap.width / pixelRatio ), fastRound( bitmap.height / pixelRatio )
|
||||
);
|
||||
renderedFromCache = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user