mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-17 14:44:07 +00:00
functional listbox
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@328 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -370,7 +370,8 @@ MwLLPixmap MwLLCreatePixmap(MwLL handle, unsigned char* data, int width, int hei
|
||||
r->use_shm = XShmQueryExtension(handle->display) ? 1 : 0;
|
||||
r->data = malloc(sizeof(unsigned long) * width * height);
|
||||
|
||||
XRenderQueryExtension(handle->display, &evbase, &erbase) ? 1 : 0;
|
||||
r->use_render = XRenderQueryExtension(handle->display, &evbase, &erbase) ? 1 : 0;
|
||||
r->use_render = 0;
|
||||
|
||||
/* FIXME */
|
||||
r->use_shm = 0;
|
||||
@@ -477,14 +478,14 @@ void MwLLDrawPixmap(MwLL handle, MwRect* rect, MwLLPixmap pixmap) {
|
||||
|
||||
for(y = 0; y < (int)rect->height; y++) {
|
||||
for(x = 0; x < (int)rect->width; x++) {
|
||||
double sy = (double)y / rect->height * pixmap->height;
|
||||
double sx = (double)x / rect->width * pixmap->width;
|
||||
char* ipx;
|
||||
char* opx;
|
||||
int sy = y * pixmap->height / rect->height;
|
||||
int sx = x * pixmap->width / rect->width;
|
||||
char* ipx;
|
||||
char* opx;
|
||||
sy = (int)sy;
|
||||
sx = (int)sx;
|
||||
|
||||
ipx = &pixmap->image->data[(int)(pixmap->width * sy + sx) * (pixmap->image->bitmap_unit / 8)];
|
||||
ipx = &pixmap->image->data[(pixmap->width * sy + sx) * (pixmap->image->bitmap_unit / 8)];
|
||||
opx = &d[(rect->width * y + x) * (pixmap->image->bitmap_unit / 8)];
|
||||
memcpy(opx, ipx, pixmap->image->bitmap_unit / 8);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user