joedf / ImgBeamer

SEM image formation process demo tool
https://joedf.github.io/ImgBeamer
MIT License
2 stars 0 forks source link

Toggle for smoothing option #47

Closed joedf closed 5 months ago

joedf commented 5 months ago

It looks like canvas image smoothing can only be disabled AFTER a layer has been added to the stage. https://github.com/konvajs/konva/issues/306#issuecomment-351263036

A simple set like this (currently used) before it is added to a stage will NOT work.

var ctx = layer.getContext();
ctx.imageSmoothingEnabled = false;

stage.add(layer);

Instead, this will work.

stage.add(layer);

var ctx = layer.getContext();
ctx.imageSmoothingEnabled = false;

Task: Fix this by default and add toggle in display options.