forked from pyrite-dev/milsko
fix color leak
This commit is contained in:
parent
541499f43c
commit
1f4fddfa67
1 changed files with 4 additions and 2 deletions
|
|
@ -47,6 +47,8 @@ static void color_set_disabled_if_disabled(MwWidget handle, MwLLColor rgb) {
|
||||||
rgb->common.green = rgb->common.green + (c->common.green - rgb->common.green) * 0.5;
|
rgb->common.green = rgb->common.green + (c->common.green - rgb->common.green) * 0.5;
|
||||||
rgb->common.blue = rgb->common.blue + (c->common.blue - rgb->common.blue) * 0.5;
|
rgb->common.blue = rgb->common.blue + (c->common.blue - rgb->common.blue) * 0.5;
|
||||||
MwLLColorUpdate(handle->lowlevel, rgb, rgb->common.red, rgb->common.green, rgb->common.blue);
|
MwLLColorUpdate(handle->lowlevel, rgb, rgb->common.red, rgb->common.green, rgb->common.blue);
|
||||||
|
|
||||||
|
MwLLFreeColor(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -217,7 +219,7 @@ void MwDrawWidgetBack(MwWidget handle, MwRect* rect, MwLLColor color, int invert
|
||||||
|
|
||||||
if(rect->width <= 0 || rect->height <= 0) return;
|
if(rect->width <= 0 || rect->height <= 0) return;
|
||||||
|
|
||||||
col = invert ? MwLightenColor(handle, color, -8, -8, -8) : color;
|
col = invert ? MwLightenColor(handle, color, -8, -8, -8) : MwLightenColor(handle, color, 0, 0, 0);
|
||||||
color_set_disabled_if_disabled(handle, col);
|
color_set_disabled_if_disabled(handle, col);
|
||||||
|
|
||||||
if(MwGetInteger(handle, MwNmodernLook)) {
|
if(MwGetInteger(handle, MwNmodernLook)) {
|
||||||
|
|
@ -225,7 +227,7 @@ void MwDrawWidgetBack(MwWidget handle, MwRect* rect, MwLLColor color, int invert
|
||||||
} else {
|
} else {
|
||||||
MwDrawRect(handle, rect, col);
|
MwDrawRect(handle, rect, col);
|
||||||
}
|
}
|
||||||
if(col != color) MwLLFreeColor(col);
|
MwLLFreeColor(col);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MwDrawDiamond(MwWidget handle, MwRect* rect, MwLLColor color, int invert) {
|
void MwDrawDiamond(MwWidget handle, MwRect* rect, MwLLColor color, int invert) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue