Comments

26 views
Skip to first unread message

wilq

unread,
Apr 16, 2010, 8:47:59 AM4/16/10
to jQueryRotate
Have any commments ? You can put it here!


--
Subscription settings: http://groups.google.com/group/jqueryrotate/subscribe?hl=pl

Robin

unread,
May 22, 2010, 6:48:39 PM5/22/10
to jQueryRotate
Lovely plugin - just needs to be able to "hide" the increased canvas
size so it doesn't change page layout, maybe an option to "autocrop"
rather than the current default of increasing the size.

Saying that, if you do make a general canvas manipulation jquery
plugin I'm hoping it'll make it's way into the trunk ;-)

wilq

unread,
May 26, 2010, 3:44:10 AM5/26/10
to jQueryRotate
Its a long discussion should or should it not change page layout :) I
think that answer is not as simple - what do you mean by keeping page
layout? If you have a text around image - when you want to keep size
it will just overlap this text and look ugly. Right now I doing
bounding box calculation, but you are free to put this image inside an
element that will position it correspondelly. Anyway I see the point
of having this option so I will add this as an option in next release
then.

Robin

unread,
May 29, 2010, 3:58:29 PM5/29/10
to jQueryRotate
Ended up rolling my own version as I needed to do some extra
manipulation anyway, but I'm currently copying the original image's
css / class / id into the new canvas - and (optionally) adding extra
margin negative numbers to keep it from changing the page layout. Also
making the canvas a lot smaller than you are by wasting a few cycles
on maths -
width = $(el).width() || parseInt($(el).css('width'));
height = $(el).height() || parseInt($(el).css('height'));
add_width = Math.ceil((Math.abs(Math.sin(angle) * height) +
Math.abs(Math.cos(angle) * width))) - width + 1;
add_height = Math.ceil((Math.abs(Math.sin(angle) * width) +
Math.abs(Math.cos(angle) * height))) - height + 1;
- Mine is slightly different again as I'm also adding a picture frame
and drop shadow so I add a little more space around things.

I also found that I needed to only do stuff after the image had
finished loading (similar to how jquery onImagesLoad does it) as it
needed to finish loading the images and I was trying to do it directly
after adding the image element ;-)

Making mine into a framework for rotating, framing and adding drop
shadow directly (due to where it's getting used) - but only playing
with pure html5 as I don't really care about ie for my target audience.

Paweł Witkowski

unread,
May 31, 2010, 3:57:50 AM5/31/10
to jquery...@googlegroups.com
I released new version last week that you can turn off bounding box :)
check it out first :)

2010/5/29 Robin <ryco...@rycochet.com>:

--
Pawel Witkowski
Senior JavaScript Developer / Frontend Architect
webpage: http://wilq32.blogspot.com

Reply all
Reply to author
Forward
0 new messages