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
height = size.y,
screenWidth = size.x,
screenHeight = size.y,
viewport = new()
{
X = 0,
Y = 0,
Width = size.x,
Height = size.y,
Scale = pageScaleFactor
}
});
Size = size;
PageScaleFactor = pageScaleFactor;
......
......@@ -111,7 +111,6 @@ namespace bessw.Unity.WebView
{
Width = tab.Size.x,
Height = tab.Size.y,
Scale = PageScaleFactor
}, (screenshot) =>
{
......@@ -219,7 +218,7 @@ namespace bessw.Unity.WebView
// invert y because the browser has y=0 on the top
Vector2 invertedLocalPos = new Vector2(localPoint.x, rectTransform.rect.size.y - localPoint.y);
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}");
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