Comments (4)
Hello @schwarmau, thanks for the report.
I'll investigate the issue as soon as I get home.
Perhaps this is related to the reason Width will not work as well.
Idk which width are you referring to but, if that is the width of the component, you need to specify it as there is no default.
Will get back to you asap.
from canvas.
Idk which width are you referring to but, if that is the width of the component, you need to specify it as there is no default.
I think I worded my sentence poorly. I meant to say: Perhaps the lack of support for other properties of TextMetrics (such as actualBoundingBoxLeft, see: https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics) might be affecting the supported property of TextMetrics (width). I haven't done much testing of this, though, so I'm not sure.
from canvas.
Hello @schwarmau
Yes, some properties are not being set and that affect the precision of TextMetrics.
I'll mark this issue as a bug and will make sure it goes in on the next release.
If you want it faster, please feel free to submit a PR and I'll review/merge it right away.
Thanks!
from canvas.
I looked into this. TextMetrics.width is not an enumerable property (in the current spec, it has no enumerable properties at all; don't ask me why). As a result, it is always serialized to JSON as an empty object ("{}").
I'll look into writing up a PR that converts the native TextMetrics object to a DTO with a standard, enumerable width property that can be properly serialized.
from canvas.
Related Issues (20)
- Blazor-server canvas flickering HOT 2
- Could not find 'BlazorExtensions.Canvas2d.add' ('BlazorExtensions' was undefined) HOT 4
- Support for Blazor Canvas Extension in .NET MAUI? HOT 6
- Scaling error. Reset scale?
- WebGL: INVALID_OPERATION: drawArrays: no valid shader program in use
- Resizing the Canvas to fit Container HOT 4
- Can we have the published release with the globalCompositeOperation support
- How to place and Image inside of the Canvas HOT 1
- Just FYI - we have a "mega-fork" of this project with quite a different goal but updated to .net6 and newer ts/webpack
- Colors are misapplied in Blazor WebAssembly ASP.NET Core hosted app when there are multiple asysnc drawings.
- CreatePatternAsync HOT 1
- How to reset the Sketchpad
- Blazor WebAssembly in process runtime
- Unable to change the stroke color per rect.
- Future plans? HOT 2
- MeasureText have only width informations HOT 4
- UniformAsync
- CreateCanvas2D (non async) isn't working
- Mouse Events to NuGet
- BECanvasComponent could not be found HOT 2
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 canvas.