Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix font-size calculation if font-family's differ #2

Merged
merged 1 commit into from

2 participants

@melo

If the original DOM element and the copy DOM element have very different
font-family's, this calculation could be way off, and generate a very big
overlay.

By using the copy's width and height we do the calculation with
the final font-family and assure that its always good.

@melo melo Fix font-size calculation if font-family's differ
If the original DOM element and the copy DOM element have very different
font-family's, this calculation could be way off, and generate a very big
overlay.

By using the copy's width and height we do the calculation with
the final font-family and assure that its always good.
9bec484
@tatey
Owner

Good pickup. Thanks for the patch!

@tatey tatey merged commit f379513 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 5, 2011
  1. @melo

    Fix font-size calculation if font-family's differ

    melo authored
    If the original DOM element and the copy DOM element have very different
    font-family's, this calculation could be way off, and generate a very big
    overlay.
    
    By using the copy's width and height we do the calculation with
    the final font-family and assure that its always good.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 jquery.zoomabletype.js
View
4 jquery.zoomabletype.js
@@ -61,8 +61,8 @@
},
resize: function() {
- var width = ZoomableType._win.width() * 90 / this.original.width(),
- height = ZoomableType._win.height() * 90 / this.original.height();
+ var width = ZoomableType._win.width() * 90 / this.copy.width(),
+ height = ZoomableType._win.height() * 90 / this.copy.height();
this.copy.css('font-size', (width < height ? width : height) + '%');
this._style()._center();
Something went wrong with that request. Please try again.