how to make stage responsive?
See original GitHub issuehttps://konvajs.github.io/docs/sandbox/Responsive_Canvas.html
this is my code
computed: {
stage() {
return this.$refs.stage.getStage();
},
},
const scale = 2;
this.stage.width = this.stage.width * scale;
this.stage.height = this.stage.height * scale;
this.stage.scale({ x: scale, y: scale });
this.configCircle.x = this.configCircle.x - 50;
this.stage.draw();
the stage size is not changing,the canvas size seems can’t be changed by this way,but i can see the circle scale 2x bigger.
i see your componet, it has two div outside the canvas,it seems must set spectified width and hieght.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top Results From Across the Web
How to make a responsive UI in JavaFX - Eden Coding
Any attempt to make JavaFX behave responsively must start by registering a listener to the widthProperty of the Stage object. Changes to the ......
Read more >Responsive Canvas Stage Demo - Konva
So first of all, there are many way to make your canvas stage “responsive”. And you may need a different behavior for different...
Read more >How to make responsive design in javafx - Stack Overflow
AnchorPane; import javafx.stage.Stage; public class Main extends Application { @Override public void start(Stage primaryStage) { try ...
Read more >How to create a responsive layout in JavaFX - GuiGarage
Here I will show how a first solution to create such a responsive layout. ... public void start(Stage primaryStage) throws Exception { this....
Read more >W+H Reshaping Responsive Stage - Adobe Support Community
It explains how to make canvas content responsive on desktop devices. I updated the example with a rec that scales proportionally according ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Konva is doing automatic adjustments for HDPI screens (like retina). It is required for sharp and good display. You can read more about it here: https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio
If you don’t need it, you can manually change that behavior:
Sure. My you just need to set CSS values to fit the required size. Updated the demo: https://codesandbox.io/s/502p384jyp