Skip to content

Commit 33fb030

Browse files
committed
Reduced the count of calculation
1 parent 294bf74 commit 33fb030

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

browser/components/MarkdownPreview.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -845,8 +845,8 @@ export default class MarkdownPreview extends React.Component {
845845

846846
const zoomImgWidth = img.width * magnification
847847
const zoomImgHeight = img.height * magnification
848-
const zoomImgTop = document.body.clientHeight / 2 - zoomImgHeight / 2
849-
const zoomImgLeft = document.body.clientWidth / 2 - zoomImgWidth / 2
848+
const zoomImgTop = (document.body.clientHeight - zoomImgHeight) / 2
849+
const zoomImgLeft = (document.body.clientWidth - zoomImgWidth) / 2
850850
const originalImgTop = img.y + rect.top
851851
const originalImgLeft = img.x + rect.left
852852
const originalImgRect = {

0 commit comments

Comments
 (0)