Skip to content

Commit

Permalink
Ignore dynamic type when changing zoom level (#3638)
Browse files Browse the repository at this point in the history
<!--
Note: This checklist is a reminder of our shared engineering
expectations. Feel free to change it, although assigning a GitHub
reviewer and the items in bold are required.

⚠️ If you're an external contributor, please file an issue first before
working on a PR, as we can't guarantee that we will accept your changes
if they haven't been discussed ahead of time. Thanks!
-->

Task/Issue URL:
https://app.asana.com/0/1205591970852438/1208863000782015/f
Tech Design URL:
CC:

**Description**:

Ignores dynamic type when changing zoom level.

<!--
If at any point it isn't actively being worked on/ready for
review/otherwise moving forward strongly consider closing it (or not
opening it in the first place). If you decide not to close it, use Draft
PR while work is still in progress or use `DO NOT MERGE` label to
clarify the PRs state and comment with more information.
-->

**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

<!--
Before submitting a PR, please ensure you have tested the combinations
you expect the reviewer to test, then delete configurations you *know*
do not need explicit testing.

Using a simulator where a physical device is unavailable is acceptable.
-->

**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)
  • Loading branch information
quanganhdo authored Nov 28, 2024
1 parent 4414b0f commit 9f3a409
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions DuckDuckGo/TextZoomCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 9f3a409

Please sign in to comment.