Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType Demo Programs
Commits:
-
d719135f
by Alexei Podtelezhnikov at 2022-09-23T22:27:04-04:00
1 changed file:
Changes:
... | ... | @@ -119,8 +119,8 @@ |
119 | 119 | int width,
|
120 | 120 | int height )
|
121 | 121 | {
|
122 | - long pitch;
|
|
123 | - int delta;
|
|
122 | + int delta;
|
|
123 | + int pitch;
|
|
124 | 124 | |
125 | 125 | |
126 | 126 | /* clip rectangle to source bitmap */
|
... | ... | @@ -157,22 +157,20 @@ |
157 | 157 | return 1;
|
158 | 158 | |
159 | 159 | /* now, setup the blitter */
|
160 | - pitch = blit->src_pitch = source->pitch;
|
|
160 | + blit->x = x;
|
|
161 | + blit->y = y;
|
|
162 | + blit->width = width;
|
|
163 | + blit->height = height;
|
|
161 | 164 | |
162 | - blit->src_line = source->buffer + y * pitch;
|
|
165 | + pitch = blit->src_pitch = source->pitch;
|
|
163 | 166 | if ( pitch < 0 )
|
164 | - blit->src_line -= ( source->rows - 1 ) * pitch;
|
|
167 | + y -= source->rows - 1;
|
|
168 | + blit->src_line = source->buffer + y * pitch;
|
|
165 | 169 | |
166 | 170 | pitch = blit->dst_pitch = target->bytes_per_line;
|
167 | - |
|
168 | - blit->dst_line = (unsigned char*)target->data + y * pitch;
|
|
169 | 171 | if ( pitch < 0 )
|
170 | - blit->dst_line -= ( target->height - 1 ) * pitch;
|
|
171 | - |
|
172 | - blit->x = x;
|
|
173 | - blit->y = y;
|
|
174 | - blit->width = width;
|
|
175 | - blit->height = height;
|
|
172 | + y -= target->height - 1;
|
|
173 | + blit->dst_line = (unsigned char*)target->data + y * pitch;
|
|
176 | 174 | |
177 | 175 | return 0;
|
178 | 176 | }
|