Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Fix DPI scaling for debugging overlay highlights",
"packageName": "react-native-windows",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@ void DebuggingOverlayComponentView::HandleCommand(
if (auto root = rootComponentView()) {
auto rootVisual = root->OuterVisual();
auto brush = m_compContext.CreateColorBrush({204, 200, 230, 255});
float scaleFactor = m_layoutMetrics.pointScaleFactor;
for (auto &element : elements) {
auto overlayVisual = m_compContext.CreateSpriteVisual();
overlayVisual.Size({element.width, element.height});
overlayVisual.Offset({element.x, element.y, 0.0f});
overlayVisual.Size({element.width * scaleFactor, element.height * scaleFactor});
overlayVisual.Offset({element.x * scaleFactor, element.y * scaleFactor, 0.0f});
overlayVisual.Brush(brush);

rootVisual.InsertAt(overlayVisual, root->overlayIndex() + m_activeOverlays);
Expand Down
Loading