Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #453 ink strokes not captured until stylus up #540

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

theJosher
Copy link

This fixes #453 by using reflection to get a frozen copy of DrawingGroups from the inking thread's real-time visual. Under normal use cases, it seems strokes are transitioned from the inking thread to the UI thread's InkCanvas when completed (e.g. stylus up). However, in our sort of unique case of animating the drawing process, we do want to see the real-time visual incrementally, so this fix pulls over the partial stroke as DrawingGroups into an image overlay that is Z-ordered above the InkCanvas. This extra partial-stroke-copy logic is only performed when a capture is desired (via thetimer), and the inking overlay is emptied when no partial stroke is alive.

/// </summary>
/// <param name="visual">The visual to convert to a DrawingGroup</param>
/// <param name="drawingGroup">The target DrawingGroup to be populated</param>
static public void visualToFrozenDrawingGroup(this Visual visual, DrawingGroup drawingGroup)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, just a minor tweak in here, but I can do later:

public static void VisualToFrozenDrawingGroup

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be updated now. Sorry, we have an awful coding standard at 🏭 to which I am strongly habituated. I think I fixed the flicker as well.

@NickeManarin
Copy link
Owner

Thanks for taking your time to deal with that issue. I'm waiting to get in hands with a computer with touch this week in order to test it.

@NickeManarin
Copy link
Owner

I still could not test it, is it working ok for you?

@theJosher
Copy link
Author

theJosher commented Dec 6, 2019 via email

@NickeManarin
Copy link
Owner

Sorry for the delay again. I was able to test the recorder by using an input injector (mouse input to touch or pen input).

The recorder looks fine.

If it's still janky, maybe the TransparentCornerPoint could use the width and height of the current board size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Board with touchscreen not drawing as intended
2 participants