enable frame to draw its own border. also made more color wheel changes

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@383 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
IoIxD
2025-10-16 23:20:45 +00:00
parent 04e259e66b
commit 7380be6f57
3 changed files with 91 additions and 34 deletions

View File

@@ -8,15 +8,34 @@ static int create(MwWidget handle) {
}
static void draw(MwWidget handle) {
MwRect r;
MwRect fr;
MwRect rr;
MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
r.x = 0;
r.y = 0;
r.width = MwGetInteger(handle, MwNwidth);
r.height = MwGetInteger(handle, MwNheight);
int hasBorder = MwGetInteger(handle, MwnhasBorder);
int inverted;
MwDrawRect(handle, &r, base);
if(hasBorder) {
inverted = MwGetInteger(handle, MwNinverted);
fr.x = 0;
fr.y = 0;
fr.width = MwGetInteger(handle, MwNwidth);
fr.height = MwGetInteger(handle, MwNheight);
MwDrawFrame(handle, &fr, base, inverted);
rr.x = MwDefaultBorderWidth;
rr.y = MwDefaultBorderWidth;
rr.width = MwGetInteger(handle, MwNwidth) - (MwDefaultBorderWidth * 2);
rr.height = MwGetInteger(handle, MwNheight) - (MwDefaultBorderWidth * 2);
} else {
rr.x = 0;
rr.y = 0;
rr.width = MwGetInteger(handle, MwNwidth);
rr.height = MwGetInteger(handle, MwNheight);
}
MwDrawRect(handle, &rr, base);
MwLLFreeColor(base);
}