mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
a1b87e2548
commit
7156f4be99
@ -663,7 +663,6 @@ var RibbonsPrototype = {
|
|||||||
|
|
||||||
|
|
||||||
// do the calc...
|
// do the calc...
|
||||||
//* XXX is this fast enough???
|
|
||||||
scale = scale || this.scale()
|
scale = scale || this.scale()
|
||||||
var css = getComputedStyle(img[0])
|
var css = getComputedStyle(img[0])
|
||||||
var res = dim == 'height' ? parseFloat(css.height)
|
var res = dim == 'height' ? parseFloat(css.height)
|
||||||
@ -673,33 +672,6 @@ var RibbonsPrototype = {
|
|||||||
: null
|
: null
|
||||||
// get size for given scale...
|
// get size for given scale...
|
||||||
res = res ? res * scale : res
|
res = res ? res * scale : res
|
||||||
//*/
|
|
||||||
|
|
||||||
/* XXX this is very precise and fast but depends on scale...
|
|
||||||
// NOTE: this is the actual visible size...
|
|
||||||
var rect = img[0].getBoundingClientRect()
|
|
||||||
var res = dim == 'height' ? rect.height
|
|
||||||
: dim == 'width' ? rect.width
|
|
||||||
: dim == 'max' ? Math.max(rect.height, rect.width)
|
|
||||||
: dim == 'min' ? Math.min(rect.height, rect.width)
|
|
||||||
: null
|
|
||||||
// get size for given scale...
|
|
||||||
// XXX remove the dependency on .scale() here!
|
|
||||||
res = scale != null ? (res / this.scale() * scale) : res
|
|
||||||
//*/
|
|
||||||
|
|
||||||
/* XXX this does not depend on scale but is rounded to nearest pixel...
|
|
||||||
// XXX offsetX is rounded to nearest pixel...
|
|
||||||
img = img[0]
|
|
||||||
scale = scale || this.scale()
|
|
||||||
var res = dim == 'height' ? img.offsetHeight
|
|
||||||
: dim == 'width' ? img.offsetWidth
|
|
||||||
: dim == 'max' ? Math.max(img.offsetHeight, img.offsetWidth)
|
|
||||||
: dim == 'min' ? Math.min(img.offsetHeight, img.offsetWidth)
|
|
||||||
: null
|
|
||||||
// get size for given scale...
|
|
||||||
res = res && scale ? res * scale : res
|
|
||||||
//*/
|
|
||||||
|
|
||||||
// remove the tmp image we created...
|
// remove the tmp image we created...
|
||||||
if(tmp != null){
|
if(tmp != null){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user