Coder Social home page Coder Social logo

Comments (4)

lavrton avatar lavrton commented on July 28, 2024 2

I see now.

Shapes with (1) stroke and (2) fill and (3) opacity are rendered via special "buffer render". More about this behavior here: https://konvajs.org/docs/performance/Disable_Perfect_Draw.html

There are two solutions for your issue:

  1. First, you can just follow the tip from the documentation and disable "perfectDraw".

  2. Or you can just update pixelRatio of the stage's buffer canvas:

layerRef.current
        .getStage()
        .bufferCanvas.setPixelRatio(window.devicePixelRatio);

from react-konva.

lavrton avatar lavrton commented on July 28, 2024

Why are you changing pixel ratio?

On don't see any blur in MacOs on Chrome. What is your system?

from react-konva.

florton avatar florton commented on July 28, 2024

@lavrton The layer pixel ratio does not automatically update when the user zooms in or out with the browser. Without changing it, all the shapes will be blurry in the examples if the page is zoomed in. I am using chrome on windows.

Can you confirm that on the codesandbox example, you zoomed out all the way, clicked refresh in the browser preview tab, and then zoomed all the way in. I can reproduce the issue consistently.

image

from react-konva.

florton avatar florton commented on July 28, 2024

@lavrton Thank you for the information, updating the stage bufferCanvas and the layer pixel ratios fixed the issue 👍

An alternate solution I found was removing opacity and instead using hex colors with alpha values for stroke and fill.

from react-konva.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.