The code was mixing logical and physical sizes, causing glyphs being
doubly scaled down. Instead, this patch introduces:
* Physical* and Logical* euclid length/size/rect aliases
* some extraction traits for getting the scalars in rects/sizes as lengths (until euclid has them
built-in)
* wrapper traits/types for safely extracting the physical font metrics the
compiler generates (i16)
* Fix a bug in the text height calculation where we failed to take the
descent into account
When "combining" information from winit's ReceiveCharacter and
KeyboardInput events, then do not create a second KeyPress event
when the KeyboardInput contained a control character.
This makes us not send duplicate events for `Tab`, but leaves the
handling for e.g. `Ctrl-C` unchanged.
Move the specific data out of SceneItem into separate vectors. This makes the process of
sorting/moving scene items faster (less memory to move) and makes rectangle rich scenes
consume less memory.
This also paves the way for a "SimpleSceneTexture" vs. a more complex texture.
Since the cat picture is now in jpeg, we need to be able to decaode it
from the tests.
Luckily on the CI this works fine beacause we do a full cargo test that
build all the crates including the gl crate that has the jpeg format enaabled,
but if we try to compile the test with limited feature set, it wouldn't be available.
Bump the femtovg dependency to ensure we get the fix for error detection on the renderer side
and handle it in the GL backend side by rendering text to the 2D canvas, followed by a panic.
This was moved up to before the resize handler can be installed, as that would end up
clearing the canvas when resizing.
A message on the 2D canvas was chose over an alert message box, as the latter
is rather intrusive and would be a nightmare if many of them popped up
when viewing our docs with a browser
configured that way.
resvg produces an image with pre-multipled alpha and anecdotal evidence suggests that HTMLImageElement on an SVG does, too.
This might need further restriction for the HTMLImageElement case just to svg, but
let's try this.
The README.md contains the warning that used to be in lib.rs.
Add README.md files to all internal crates
... pointing to the official public crate to use instead.
Rename internal crates
fixup: README files
fixup rename
This API allows specifying a callback that will be invoked when setting
up graphics (great for compiling shaders), before rendering a frame (but
after the clearning of the surface background), after rendering a frame
(before swapbuffers) and when releasing graphics resources.