Skip to content

Conversation

@ijklam
Copy link
Contributor

@ijklam ijklam commented Nov 5, 2025

What does the pull request do?

Adds:

  1. A message that posted by the parent window: previewer dpi changed event scaling, with a parameter scale.
    The parameter scale will be used to ensure the mouse events can be raised on the correct position.
    This can be used by the VSCode extension before sending a ClientRenderInfoMessage to the DesignerHost.
  2. A message that posted to the parent window: canvas resize event resize, with 2 parameters width and height.
    This can be used to tell the new size of the canvas to the parent page, as when the iframe's content size changed, the iframe will not auto acquire the new size.

Fixs:

  1. It can now display clearly on high-dpi screen or a scaled browser
  2. The mouse events can be raised on the correct position (by removing the margin on <body> added by the browser and some other change)

What is the current behavior?

  1. The previewer is blurred.
  2. The mouse events are not raised on correct position.
2025-11-05.170551.mp4

What is the updated/expected behavior with this PR?

  1. The previewer is clearly.
  2. The mouse events are raised on correct position, even the extension changes the render dpi using ClientRenderInfoMessage.
2025-11-05.170149.mp4

How was the solution implemented (if it's not obvious)?

Checklist

Breaking changes

Fixed issues

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 12.0.999-cibuild0059794-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

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.

2 participants