mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 08:04:45 +00:00
chore: add zoom diagnostic to embedded browser
Logs the WebView's current scale, density, and pixel widths on page finish, to confirm whether the 400% zoom is a density/viewport mismatch from streaming the WebView through SurfaceControlViewHost. Temporary, alongside the touch/session diagnostics. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgMpRcWj6y82LxLiwcuzmN
This commit is contained in:
+8
-1
@@ -242,7 +242,14 @@ class NappletBrowserService : Service() {
|
||||
override fun onPageFinished(
|
||||
view: WebView,
|
||||
url: String,
|
||||
) = pushUrl(view)
|
||||
) {
|
||||
// DIAGNOSTIC (zoom): a responsive page rendering too large points to a density/viewport
|
||||
// mismatch from streaming the WebView through SurfaceControlViewHost. scale≈4 confirms 400%.
|
||||
val dm = view.resources.displayMetrics
|
||||
@Suppress("DEPRECATION")
|
||||
Log.w(TAG, "DIAG zoom: scale=${view.scale} density=${dm.density} dmWidthPx=${dm.widthPixels} webViewWidthPx=${view.width}")
|
||||
pushUrl(view)
|
||||
}
|
||||
}
|
||||
|
||||
private fun pushUrl(view: WebView) {
|
||||
|
||||
Reference in New Issue
Block a user