fix things

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@489 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-10-24 16:54:43 +00:00
parent b598c29d33
commit 90080a3d24
8 changed files with 9 additions and 51 deletions

View File

@@ -476,6 +476,7 @@ void MwLLDestroyPixmap(MwLLPixmap pixmap) {
}
void MwLLDrawPixmap(MwLL handle, MwRect* rect, MwLLPixmap pixmap) {
if(rect->width == 0 || rect->height == 0) return;
if(pixmap->image != NULL && pixmap->use_render) {
Pixmap px = XCreatePixmap(handle->display, handle->window, pixmap->width, pixmap->height, pixmap->depth);
Pixmap mask = XCreatePixmap(handle->display, handle->window, rect->width, rect->height, 1);

View File

@@ -8,6 +8,7 @@ static void lldrawhandler(MwLL handle, void* data) {
(void)data;
h->bgcolor = NULL;
MwDispatch(h, draw);
if(h->draw_inject != NULL) h->draw_inject(h);
}

View File

@@ -561,7 +561,7 @@ MwLLPixmap MwLoadRaw(MwWidget handle, unsigned char* rgb, int width, int height)
MwLLPixmap px;
unsigned char* out = malloc(width * height * 4);
int i;
MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwLLColor base = handle->bgcolor == NULL ? MwParseColor(handle, MwGetText(handle, MwNbackground)) : handle->bgcolor;
memset(out, 0, width * height * 4);
for(i = 0; i < width * height; i++){
@@ -583,7 +583,7 @@ MwLLPixmap MwLoadRaw(MwWidget handle, unsigned char* rgb, int width, int height)
}
}
MwLLFreeColor(base);
if(handle->bgcolor == NULL) MwLLFreeColor(base);
px = MwLLCreatePixmap(handle->lowlevel, out, width, height);

View File

@@ -1,46 +0,0 @@
/* $Id$ */
#include <Mw/Milsko.h>
/* XPM */
char* MwIconQuestion[] = {
/* columns rows colors chars-per-pixel */
"32 32 6 1 ",
" c None",
". c orange",
"X c red",
"o c firebrick",
"O c SlateGray",
"+ c lavender",
/* pixels */
" ",
" ........... ",
" ..XXXXXXXXXXXXX ",
" .XXXXXoooooooooXXO ",
" .XXXXoooooooooooooXO ",
" .XXXXooooXXXXoooooooXO ",
" .XXXXooooOOO XXooooooooO ",
" .XXXXooooOOO XXoooooooOO ",
" .XXXoooooOO .XXooooooOO ",
" .XXXooooooO .XXooooooOO ",
" XXXooooooOO .XXooooooOO ",
" XXooooooOO .XXXooooooOO ",
" XXooooOOO .XXooooooOOO ",
" XXooOOO .XXooooooOOO ",
" OOOOO .XXooooooOOOO ",
" OOO .XXooooooOOOO ",
" .XXoooooOOOOO ",
" .XXoooooOOOO ",
" .XXoooooOOOO ",
" .XXooooOOOO ",
" XXoooOOOO ",
" XXoOOOO ",
" OOOOO ",
" .XXooO ",
" .X.XXoo ",
" .X.X.XXoo ",
" .XX.XXXooO ",
" XXXXXXooOO ",
" XXXXooOOO ",
" XoooOOOO ",
" OOOOOO ",
" OOOO "};

View File

@@ -120,12 +120,11 @@ static int ttf_MwDrawText(MwWidget handle, MwPoint* point, const char* text, int
int ox = x + (lsb * ttf->scale) + cx;
int oy = (ttf->ascent * ttf->scale) + y0 + cy;
unsigned char* opx = &px[(oy * tw + ox) * 4];
double a = out[cy * ow + cx];
opx[0] = color->red;
opx[1] = color->green;
opx[2] = color->blue;
opx[3] = a;
opx[3] = out[cy * ow + cx];
}
}

View File

@@ -214,6 +214,7 @@ static void frame_draw(MwWidget handle) {
r2.width = r.width;
r2.height = MwTextHeight(handle, "M");
MwDrawRect(handle, &r2, text);
handle->bgcolor = text;
}
if(lb->list[i].pixmap != NULL) {
MwRect r2;
@@ -238,6 +239,7 @@ static void frame_draw(MwWidget handle) {
if(j == 0) p.x -= MwGetInteger(handle->parent, MwNleftPadding);
}
p.y += MwTextHeight(handle, "M") / 2;
handle->bgcolor = NULL;
}
MwDrawFrame(handle, &r, base, 1);