Skip to content

Commit a18d128

Browse files
committed
Found the root cause of the zoom issue #163 #158
1 parent af840dd commit a18d128

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/scenes/content/src/stores/browser/browserStore.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class BrowserStore {
1919
this.searchTerm = ''
2020
this.searchNextHash = 0
2121

22-
this.zoomFactor = 0.0
22+
this.zoomFactor = 1.0
2323

2424
/* ****************************************/
2525
// Listeners
@@ -116,7 +116,7 @@ class BrowserStore {
116116
}
117117

118118
handleDecreaseZoom () {
119-
this.zoomFactor = Math.max(-1.5, this.zoomFactor - 0.1)
119+
this.zoomFactor = Math.max(0.5, this.zoomFactor - 0.1)
120120
}
121121

122122
handleResetZoom () {

src/scenes/mailboxes/src/stores/mailbox/ServiceReducer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class ServiceReducer {
5353
*/
5454
static decreaseZoom (mailbox, service) {
5555
return service.changeData({
56-
zoomFactor: Math.max(-1.5, service.zoomFactor - 0.1)
56+
zoomFactor: Math.max(0.5, service.zoomFactor - 0.1)
5757
})
5858
}
5959

@@ -63,7 +63,7 @@ class ServiceReducer {
6363
* @param service: the service to update
6464
*/
6565
static resetZoom (mailbox, service) {
66-
return service.changeData({ zoomFactor: 0.0 })
66+
return service.changeData({ zoomFactor: 1.0 })
6767
}
6868

6969
/* **************************************************************************/

src/scenes/sharedui/Components/BrowserView.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default class BrowserView extends React.Component {
1717
searchTerm: PropTypes.string
1818
}
1919
static defaultProps = {
20-
zoomFactor: 0.0,
20+
zoomFactor: 1.0,
2121
searchId: `${Math.random()}`
2222
}
2323
static REACT_WEBVIEW_EVENTS = WebView.REACT_WEBVIEW_EVENTS
@@ -49,8 +49,8 @@ export default class BrowserView extends React.Component {
4949
* be really agressive about setting zoom levels
5050
*/
5151
handleZoomFixEvent = () => {
52-
if (this.props.zoomFactor !== 0.0) {
53-
this.refs[WEBVIEW_REF].setZoomLevel(this.props.zoomFactor)
52+
if (this.props.zoomFactor !== 1.0) {
53+
this.refs[WEBVIEW_REF].setZoomFactor(this.props.zoomFactor)
5454
}
5555
}
5656

@@ -68,7 +68,7 @@ export default class BrowserView extends React.Component {
6868

6969
// Zoom
7070
if (prevProps.zoomFactor !== zoomFactor) {
71-
this.refs[WEBVIEW_REF].setZoomLevel(zoomFactor)
71+
this.refs[WEBVIEW_REF].setZoomFactor(zoomFactor)
7272
}
7373

7474
// Search

0 commit comments

Comments
 (0)