Skip to content

Version 1.5.0

Choose a tag to compare

@Abduction-Lamp Abduction-Lamp released this 09 Sep 23:52
· 108 commits to master since this release
257f4e0

What's Changed

A performance pass over the component. Behavior and appearance are unchanged.

Changed

  • Per-frame allocations — a frame built a path, up to four brushes and a pen. At 60 frames per second that is roughly 450 GDI+ allocations per second per animating switch. It now builds one path, one brush and one pen per frame and recolors them for each shape. They stay local to the paint: the GDI+ wrapper unit shuts the library down in its finalization, which runs before the forms are freed, so objects held in fields would be deleted after GDI+ is gone
  • Animation timer — every instance created a timer, and with it a hidden window, even when nothing ever animated. It is created on first use now
  • Hidden controls — animations are skipped while the switch is not showing, for example on an inactive tab page. The state applies immediately instead
  • Text metrics — height is measured when the font or the text changes rather than on every frame, and the font is assigned to the canvas once per paint instead of twice. Vertical centering now uses the same metric as the auto-sizing, which for some fonts disagreed with it
  • Pixel alignment — the track sits on whole pixels, so its outline stays crisp when the text makes the control an odd number of pixels tall
  • Transparent shapes — fills and strokes with zero alpha are skipped rather than rasterized

Tests

  • Rendering through PaintTo is covered, and a loop creates, renders and frees fifty instances so FastMM4 covers the drawing objects

Full Changelog: v1.4.0...v1.5.0