Fix Issue 1787 "The specified Visual is not an ancestor of this Visual" exception by albtaeler · Pull Request #1789 · oxyplot/oxyplot · GitHub
Skip to content

Fix Issue 1787 "The specified Visual is not an ancestor of this Visual" exception - #1789

Merged
VisualMelon merged 1 commit into
oxyplot:developfrom
albtaeler:Issue1787
Sep 12, 2021
Merged

VisualMelon merged 1 commit into
oxyplot:developfrom
albtaeler:Issue1787

Conversation

@albtaeler

Copy link
Copy Markdown
Contributor

Fixes #1787.

Checklist

  • I have included examples or tests
  • I have updated the change log
  • I am listed in the CONTRIBUTORS file
  • I have cleaned up the commit history (use rebase and squash)

Changes proposed in this pull request:

  • Get the window object that hosts the plot from the visual tree, not using Window.GetWindow()

My changes has a duplication of GetAncestorWindowFromVisualTree() in OxySKElement, but I think this is only a workaround, this should be fixed in the original SkiaSharp SKElement.

@oxyplot/admins

@VisualMelon VisualMelon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

Just missing documentation on one of the methods.

I'll do a proper function check tonight/tomorrow when I have time, and then give it a couple of days before merging should the other maintainers spot something.

@VisualMelon VisualMelon Sep 10, 2021 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing inline doc (per the PlotView version)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've omitted the documentation in OxySkElement, because there's nothing documented in the whole file. But I can add it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I hadn't realised; I suppose that's because it's a C&P of the provision by SkiaSharp. It would be nice to include it, given it is a divergence from the 'original' (indeed, we should consider documenting the whole file at some point).

@Jonarw Jonarw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for spotting and fixing this issue!
I don't mind the lack of documentation in OxySKElement - as you said, this whole class is mostly a workaround, ideally this would be fixed on SkiaSharp side. (Or we may even be able to get rid of the SKElement completely in the future as it is just another container).

@VisualMelon

Copy link
Copy Markdown
Contributor

@VisualMelon
VisualMelon merged commit 59011f0 into oxyplot:develop Sep 12, 2021
@albtaeler
albtaeler deleted the Issue1787 branch September 13, 2021 06:45
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.

"The specified Visual is not an ancestor of this Visual" exception in OxySKElement.OnRender()

3 participants