|
From: Peter <sw...@ho...> - 2007-01-21 19:26:19
|
With respect for Jonatan's post and opinion about the need or lack of need for enhanced scaling, I decided to try and implement the enhancement anyway. Prior to posting the patches, I wanted to outline what's been done, why and how. Essentially, the problem is when images scale either to the max x or max y dimension, but not both so as to fill the screen. When expanded, stretched, the image becomes distorted. Fitting the image to the screen, by expanding the dimension (x or y) that does not fill the screen and scaling the companion dimension by the same amount results in a non-distorted image, but one dimension will be cropped. To compensate for this, I intended to center the image so as to not cut off too much in any dimension. My original code neglected to note that ROX places all pinboard backdrops at 0,0 without regard for offset. This is needed in order for overscaling to work. So, now, I have devised 5 types of overscaling. The are: Fit - center image and crop one dimension or the other Fit L - align image on the left, cropping the right edge Fit R - align image on the right, cropping the left edge Fit T - align image on the top, cropping the bottom edge Fit B - align image on the bottom, cropping the top Two of these will always be the same as the image can be out of scale relative to the screen dimensions in only one dimension or the other. For example, a tall, narrow image can be aligned top or bottom, but the left and right margins won't ever change as they are scaled outward. Or, a long, short image can be aligned left or right, but the top and bottom margins won't ever change. Routine fitting would center the image l/r/t/b but some cropping can occur. Why do this? I downloaded a neat picture of acrobats on a bike high above a gorge. However, the picture was not framed properly, but the composition was really incredible. Fitting the image pushed the acrobats off too far to the right. Right-aligning the image focused more of the image on them and made the wallpaper usable. Scaling did not work, and Stretching the image was horribly distorted. So, the code in svn now is erroneous as it does not really center the fitted image. It aligns it to 0,0 with no regard for offset. Now, I've created two new offset variables that help compensate for it. I'm testing now, but if anyone wants the patchfile to review or play with, please email me off list: pete AT peterhyman dot com. -- Peter |