more jQuery3 related fixes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-06-21 00:43:46 +03:00
parent 70859e9341
commit f61926171a
2 changed files with 29 additions and 12 deletions

View File

@ -112,8 +112,10 @@ var SingleImageActions = actions.Actions({
var viewer = this.ribbons.viewer
var img = this.ribbons.getImage()
var w = img.outerWidth()
var h = img.outerHeight()
//* XXX these do not account for margins....
var s = getComputedStyle(img[0])
var w = parseFloat(s.width)
var h = parseFloat(s.height)
// inner diameter
var di = Math.min(h, w)

View File

@ -2236,15 +2236,15 @@ var RibbonsPrototype = {
var viewer_p = W > H ? 'landscape' : 'portrait'
var scale = this.scale()
return $(images).each(function(i, e){
var image = $(this)
// orientation...
var o = image.attr('orientation')
o = o == null ? 0 : o
var w = image.outerWidth() / scale
var h = image.outerHeight() / scale
var s = getComputedStyle(image[0])
var w = parseFloat(s.width)
var h = parseFloat(s.height)
// non-square image...
if(w != h){
@ -2301,12 +2301,19 @@ var RibbonsPrototype = {
//this.origin(target)
var o = target.attr('orientation')
o = o == null ? 0 : o
var ro = ribbon_set.offset().top
// NOTE: this appears to account for margins...
var io = target.offset().top
var h = target.outerHeight() / scale
+ parseFloat(target.css('margin-top'))
+ parseFloat(target.css('margin-bottom'))
// NOTE: we are not using .outerHeight(true) here as it returns
// the visible size rather than the real size, so we'll
// need to first divide by current scale and then multiply
// by the given scale which will introduce errors...
var s = getComputedStyle(target[0])
var h = parseFloat(o == 0 || o == 180 ? s.height : s.width)
var t = (io - ro)/scale + h/2
@ -2335,13 +2342,21 @@ var RibbonsPrototype = {
return this
}
var o = target.attr('orientation')
o = o == null ? 0 : o
var rl = ribbon.offset().left
// NOTE: this appears to account for margins...
var il = target.offset().left
var W = this.viewer.width() * scale
var w = (target.outerWidth() / scale
+ parseFloat(target.css('margin-left'))
+ parseFloat(target.css('margin-right'))) * scale
// NOTE: we are not using .outerWidth(true) here as it returns
// the visible size rather than the real size, so we'll
// need to first divide by current scale and then multiply
// by the given scale which will introduce errors...
var s = getComputedStyle(target[0])
var w = parseFloat(o == 0 || o == 180 ? s.width : s.height) * scale
var image_offset = mode == 'before' ? w/2
: mode == 'after' ? -w/2