Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 1.19 KB

README.md

File metadata and controls

31 lines (23 loc) · 1.19 KB

Slint Painter Example (Skia)

This repository is a little case-study to implement a painter (canvas) with the Slint GUI Toolkit. The drawn objects are not selectable or changeable, as this approach draws the paths directly to an image buffer via tiny-skia. This is my first contact working with Slint.

Features:

  • 🔧 different brushes: Freehand, Line, Rectangle, Ellipse
  • 💡 path preview
  • 📝 change brush size
  • 🎨 change brush color (not in GUI - color picker missing)
  • 🔄 undo and redo all operations

Annoyances:

  • 💥 fixed dimensions (at creation time)
  • 💥 touch area and displayed paths differ when the window is resized
  • 💥 no operations on individually drawn objects
  • 💥 tiny-skia engine may be slow in the path preview
  • 💥 unclear how to create a reusable slint component out of that 😕

Running

Simply use cargo to run this example

cargo run --release

Preview

screenshot-2024-02-07-130452