-
Notifications
You must be signed in to change notification settings - Fork 540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Disable automatic resizing of the canvas #1896
Comments
|
why would you want to disable automatic resizing? |
Because sometimes you have the requirement of a fixed width and height for the canvas. I stumpled upon this issue searching for options on how to set width and height to a specific value but did not find any. Then I had a look at the source code just to see that JSInterop is overriding my initially set width and height settings. So, I am in the same boat as @Code-Chops requiring the auto size thing to be controllable. |
You should not set width/height of the canvas directly, and instead use the styles:
In order to not have a blurry canvas, we need to change the stile to be Is using a style not possible? |
@mattleibow Yep, the inline style solution is also discussed in #2038 and specifically comment #2038 (comment) provides a ruleset that avoids the automatic resizing, at least visually, the internal services are still running. I think the issue can be closed. |
At the moment it's not possible to disable automatic resizing of the canvas. Besides that there is a bug in the automatic resizing, I don't want the functionality at all for my project.
Would it be a good idea to add a parameter 'IgnoreResizing' / 'DisableAutomaticResizing' to the canvas? Setting the value to 'true' will not load the SizeWatcher JavasScript at all:
SkiaSharp/source/SkiaSharp.Views.Blazor/SkiaSharp.Views.Blazor/SKCanvasView.razor.cs
Line 70 in 3c721d2
I could add the functionality if you are open for it? Thanks in advance!
The text was updated successfully, but these errors were encountered: