ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/background.C
(Generate patch)

Comparing rxvt-unicode/src/background.C (file contents):
Revision 1.205 by sf-exg, Wed Apr 11 10:06:45 2012 UTC vs.
Revision 1.206 by sf-exg, Thu Apr 12 10:22:50 2012 UTC

123 123
124# ifdef BG_IMAGE_FROM_FILE 124# ifdef BG_IMAGE_FROM_FILE
125static inline int 125static inline int
126make_align_position (int align, int window_size, int image_size) 126make_align_position (int align, int window_size, int image_size)
127{ 127{
128 int diff = window_size - image_size;
129 int smaller = min (image_size, window_size);
130
131 if (align >= 0 && align <= 100) 128 if (align >= 0 && align <= 100)
132 return diff * align / 100; 129 return lerp (0, window_size - image_size, align);
133 else if (align > 100) 130 else if (align > 100)
134 return (align - 100) * smaller / 100 + window_size - smaller; 131 return lerp (window_size - image_size, window_size, align - 100);
135 else 132 else
136 return (align + 100) * smaller / 100 - image_size; 133 return lerp (-image_size, 0, align + 100);
137} 134}
138 135
139static inline int 136static inline int
140make_clip_rectangle (int pos, int size, int target_size, int &dst_pos, int &dst_size) 137make_clip_rectangle (int pos, int size, int target_size, int &dst_pos, int &dst_size)
141{ 138{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines