mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-30 02:40:08 +00:00
cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
56bd3b943e
commit
8e06a5a3f2
50
ui/base.js
50
ui/base.js
@ -176,56 +176,6 @@ function getRelativeVisualPosition(outer, inner){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// NOTE: this is replaces by strategic outerWidth/outerHeight knowing
|
|
||||||
// about margins in a correct way...
|
|
||||||
/*
|
|
||||||
// Calculate relative position between two images or an image and a
|
|
||||||
// container
|
|
||||||
//
|
|
||||||
// This is a version of getRelativeVisualPosition(...) but it also
|
|
||||||
// accounts for:
|
|
||||||
// - partial scale (margins)
|
|
||||||
// - image rotation
|
|
||||||
//
|
|
||||||
// NOTE: both arguments ar optional...
|
|
||||||
//
|
|
||||||
// XXX this still causes a wrong inter-ribbon align...
|
|
||||||
function getRelativeImagePosition(a, b){
|
|
||||||
if(b == null){
|
|
||||||
var b = a == null ? $('.current.image') : $(a)
|
|
||||||
var a = $('.viewer')
|
|
||||||
} else {
|
|
||||||
var a = a == null ? $('.current.image') : $(a)
|
|
||||||
var b = $(b)
|
|
||||||
}
|
|
||||||
var scale = getElementScale($('.ribbon-set'))
|
|
||||||
|
|
||||||
var a_t = a.offset()
|
|
||||||
var a_l = a_t.left
|
|
||||||
var a_t = a_t.top
|
|
||||||
var a_orientation = a.attr('orientation')
|
|
||||||
if(a_orientation == 90 || a_orientation == 270){
|
|
||||||
a_t += parseFloat(a.css('margin-top')) * scale
|
|
||||||
a_l += parseFloat(a.css('margin-left')) * scale
|
|
||||||
}
|
|
||||||
|
|
||||||
var b_t = b.offset()
|
|
||||||
var b_l = b_t.left
|
|
||||||
var b_t = b_t.top
|
|
||||||
var b_orientation = b.attr('orientation')
|
|
||||||
if(b_orientation == 90 || b_orientation == 270){
|
|
||||||
b_t += parseFloat(b.css('margin-top')) * scale
|
|
||||||
b_l += parseFloat(b.css('margin-left')) * scale
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
top: b_t - a_t,
|
|
||||||
left: b_l - a_l
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
// Returns the image size (width) as viewed on screen...
|
// Returns the image size (width) as viewed on screen...
|
||||||
//
|
//
|
||||||
// dim can be:
|
// dim can be:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user