Add inking support with pressure-sensitive signature pad#327
Add inking support with pressure-sensitive signature pad#327
Conversation
Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com>
Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com>
Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com>
|
@copilot please review this PR in depth and fix the bugs. Make sure you are adding tests. I wonder if there is value in extracting a signature engine that processes the ink and movement pressure and the rest outside of a view. The the view can just forward events and data. This way the engine can be tested. Or reused outside of maui. Maybe create a SkiaSharp.Extended.Inking or something |
Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com>
Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com>
Done in 6886420. I've extracted the inking engine into a separate Architecture:
Tests: 54 unit tests covering the engine (all passing) Benefits:
|
Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com>
Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com>
Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com>
|
@copilot please merge the inking class library with the existing SkiaSharp.Extended library and keep the namespace. Similarly the tests. Then do a full review of features in our library against the windows library and update the comparison docs. Please see if anything is missing from that doc and ensure it is there. |
Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com>
Done in 458c407. Merged:
Updated docs:
Feature alignment status:
All 325 tests pass. |
|
@copilot please review the code thoroughly and think deeply. Make sure there are no bugs and the sample in the demo project is able to demonstrate all the features |
Completed thorough review in commits 458c407 through the current HEAD. Bugs fixed:
Demo page now demonstrates ALL features:
Tests: 325 pass, ~95% coverage on inking code. |
…rush property Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com>
…demo UI Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com>
Cross-platform inking engine with pressure-sensitive rendering, velocity-based stroke effects, and Catmull-Rom smoothing. Separates core engine (reusable) from MAUI view (thin wrapper).
Architecture
SKInkCanvas— stroke management, selection, undo, exportSKInkStroke— variable-width path generationSKInkStrokeBrush— appearance (color, size, cap style, smoothing, velocity mode)SKInkPoint— position, pressure, tilt, velocity, timestampFeatures
TaperLengthSelectStrokesInRect(),DeleteSelected(),SelectionChangedeventToImage(),ToPath()Example
Tests
331 unit tests covering stroke rendering, smoothing algorithms, velocity modes, selection, and edge cases.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.