Skip to content
Snippets Groups Projects
Verified Commit 923dcaa9 authored by Björn Eßwein's avatar Björn Eßwein
Browse files

fix browser scrollbars by removing viewport scale (this might result in a bit more blurry text)

parent db127971
No related branches found
No related tags found
No related merge requests found
...@@ -95,14 +95,6 @@ namespace bessw.Unity.WebView.ChromeDevTools ...@@ -95,14 +95,6 @@ namespace bessw.Unity.WebView.ChromeDevTools
height = size.y, height = size.y,
screenWidth = size.x, screenWidth = size.x,
screenHeight = size.y, screenHeight = size.y,
viewport = new()
{
X = 0,
Y = 0,
Width = size.x,
Height = size.y,
Scale = pageScaleFactor
}
}); });
Size = size; Size = size;
PageScaleFactor = pageScaleFactor; PageScaleFactor = pageScaleFactor;
......
...@@ -111,7 +111,6 @@ namespace bessw.Unity.WebView ...@@ -111,7 +111,6 @@ namespace bessw.Unity.WebView
{ {
Width = tab.Size.x, Width = tab.Size.x,
Height = tab.Size.y, Height = tab.Size.y,
Scale = PageScaleFactor
}, (screenshot) => }, (screenshot) =>
{ {
...@@ -219,7 +218,7 @@ namespace bessw.Unity.WebView ...@@ -219,7 +218,7 @@ namespace bessw.Unity.WebView
// invert y because the browser has y=0 on the top // invert y because the browser has y=0 on the top
Vector2 invertedLocalPos = new Vector2(localPoint.x, rectTransform.rect.size.y - localPoint.y); Vector2 invertedLocalPos = new Vector2(localPoint.x, rectTransform.rect.size.y - localPoint.y);
Vector2 textureScale = tab.StreamSize / rectTransform.rect.size; Vector2 textureScale = tab.StreamSize / rectTransform.rect.size;
Vector2 browserCoorinate = invertedLocalPos * textureScale / tab.PageScaleFactor; Vector2 browserCoorinate = invertedLocalPos * textureScale;// / tab.ViewportScaleFactor;
Debug.Log($"eventPos: {eventPos}, invertedLocalPos: {invertedLocalPos}, browserCoordinate: {browserCoorinate}"); Debug.Log($"eventPos: {eventPos}, invertedLocalPos: {invertedLocalPos}, browserCoordinate: {browserCoorinate}");
return new Vector2Int((int) browserCoorinate.x, (int) browserCoorinate.y); return new Vector2Int((int) browserCoorinate.x, (int) browserCoorinate.y);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment