Comments (4)
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:
-
First, you can just follow the tip from the documentation and disable "perfectDraw".
-
Or you can just update pixelRatio of the stage's buffer canvas:
layerRef.current
.getStage()
.bufferCanvas.setPixelRatio(window.devicePixelRatio);
from react-konva.
Why are you changing pixel ratio?
On don't see any blur in MacOs on Chrome. What is your system?
from react-konva.
@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.
from react-konva.
@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)
- NextJS: Module not found: Can't resolve 'canvas' HOT 2
- Issue with RTL Text
- Facing the issue now with Next.js 14: HOT 5
- OnTouchStart does not contain touches HOT 1
- getRelativePointerPosition has an offset on x when going fullscreen
- Asynchronous drawing will exceed the cropping area HOT 4
- Free drawing performance HOT 6
- Transformer is not reusable HOT 2
- Coordinates not working correctly after zoom in/out or drag of stage HOT 1
- If I want to erase only the lines drawn with a pen, how can I do that? HOT 2
- Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. HOT 1
- Arrow Drag and Transform using anchors not working HOT 4
- load data to stage HOT 1
- Positioning issue with transformer using keepRatio prop set to false HOT 1
- Breaking changes in React experimental branch
- TypeScript : `'cornerRadius'` does not exist on type `Shape<RectConfig>` HOT 4
- Trouble with Drag-and-Drop on Mobile Devices in React (with react-konva) HOT 1
- g
- Cannot drag the group if I do not drag the elements inside it HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-konva.