Skip to content

Commit

Permalink
feat: layer compositor now obey's device pixel ratio.
Browse files Browse the repository at this point in the history
  • Loading branch information
bhouston committed Sep 9, 2020
1 parent 6216a51 commit 421519f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/lib/engines/layerCompositor/LayerCompositor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ export class LayerCompositor {
premultipliedAlpha: true,
stencil: false,
});
this.context.canvasFramebuffer.devicePixelRatio = window.devicePixelRatio;
this.context.canvasFramebuffer.resize();
const plane = planeGeometry(1, 1, 1, 1);
transformGeometry(plane, makeMatrix4Translation(new Vector3(0.5, 0.5, 0.0)));
this.#bufferGeometry = makeBufferGeometryFromGeometry(this.context, plane);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/renderers/webgl/framebuffers/CanvasFramebuffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { VirtualFramebuffer } from "./VirtualFramebuffer";

export class CanvasFramebuffer extends VirtualFramebuffer {
public readonly canvas: HTMLCanvasElement | OffscreenCanvas;
devicePixelRatio = 1.0;
public autoLayoutMode = true;
public devicePixelRatio = 1.0;

constructor(context: RenderingContext) {
super(context);
Expand Down

0 comments on commit 421519f

Please sign in to comment.