From 9f3a409e10da3e0da4848ed72603d93786d32606 Mon Sep 17 00:00:00 2001 From: Anh Do <18567+quanganhdo@users.noreply.github.com> Date: Thu, 28 Nov 2024 08:27:05 -0500 Subject: [PATCH] Ignore dynamic type when changing zoom level (#3638) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task/Issue URL: https://app.asana.com/0/1205591970852438/1208863000782015/f Tech Design URL: CC: **Description**: Ignores dynamic type when changing zoom level. **Steps to test this PR**: 1. Play with the new Zoom level setting, with or without customized Dynamic Type 2. Text size on web pages should exclusively be controlled by the Zoom level setting, and Dynamic Type should only affect non-webview content **Definition of Done (Internal Only)**: * [ ] Does this PR satisfy our [Definition of Done](https://app.asana.com/0/1202500774821704/1207634633537039/f)? **Copy Testing**: * [ ] Use of correct apostrophes in new copy, ie `’` rather than `'` **Orientation Testing**: * [ ] Portrait * [ ] Landscape **Device Testing**: * [ ] iPhone SE (1st Gen) * [ ] iPhone 8 * [ ] iPhone X * [ ] iPhone 14 Pro * [ ] iPad **OS Testing**: * [ ] iOS 15 * [ ] iOS 16 * [ ] iOS 17 **Theme Testing**: * [ ] Light theme * [ ] Dark theme --- ###### Internal references: [Software Engineering Expectations](https://app.asana.com/0/59792373528535/199064865822552) [Technical Design Template](https://app.asana.com/0/59792373528535/184709971311943) --- DuckDuckGo/TextZoomCoordinator.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/DuckDuckGo/TextZoomCoordinator.swift b/DuckDuckGo/TextZoomCoordinator.swift index 3aec4d1ae2..b1bfa86f8a 100644 --- a/DuckDuckGo/TextZoomCoordinator.swift +++ b/DuckDuckGo/TextZoomCoordinator.swift @@ -110,8 +110,7 @@ final class TextZoomCoordinator: TextZoomCoordinating { private func applyTextZoom(_ webView: WKWebView) { guard isEnabled else { return } let level = textZoomLevel(forHost: webView.url?.host) - let dynamicTypeScalePercentage = UIFontMetrics.default.scaledValue(for: 1.0) - let viewScale = CGFloat(level.rawValue) / 100 * dynamicTypeScalePercentage + let viewScale = CGFloat(level.rawValue) / 100 webView.applyViewScale(viewScale) }