You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
[[ MyColors ]] Remove dependence on MCContext from MCObject::getforecolor
The only dependencies on MCContext the implementation of getforecolor() had was the context's depth, and the context's type.
Caller's of getforecolor() must now pass a MCContextType rather than an MCContext, and the never-used code path which checks a context's depth has been removed (getdepth() returns 32 for both MCGraphicsContext and MCMetaContext).
// MM-2013-08-28: [[ RefactorGraphics ]] We now pack alpha values into pixels meaning checking against MAXUNIT4 means white will always be ignored. Not sure why this check was here previously.
1447
-
if (hasindex) // && colors[i].pixel != MAXUINT4)
1448
-
{
1449
-
c = colors[i];
1450
-
return True;
1451
-
}
1452
-
else
1453
-
if (getpindex(di, i))
1454
-
{
1455
-
r_pattern = patterns[i].pattern;
1444
+
Boolean hasindex = getcindex(di, i);
1445
+
// MM-2013-08-28: [[ RefactorGraphics ]] We now pack alpha values into pixels meaning checking against MAXUNIT4 means white will always be ignored. Not sure why this check was here previously.
1446
+
if (hasindex) // && colors[i].pixel != MAXUINT4)
1447
+
{
1448
+
c = colors[i];
1449
+
return True;
1450
+
}
1451
+
elseif (getpindex(di, i))
1452
+
{
1453
+
r_pattern = patterns[i].pattern;
1456
1454
1457
-
if (gettype() == CT_STACK)
1458
-
x = y = 0;
1459
-
else
1460
-
{
1461
-
x = rect.x;
1462
-
y = rect.y;
1463
-
}
1464
-
return False;
1465
-
}
1466
-
else
1467
-
{
1468
-
if (di == DI_FORE && flags & F_DISABLED)
1469
-
{
1470
-
c = dc->getgray();
1471
-
return True;
1472
-
}
1473
-
if (MClook != LF_MOTIF && hilite && flags & F_OPAQUE
1474
-
&& !(flags & F_DISABLED))
1475
-
{
1476
-
if (p_di == DI_BACK)
1477
-
{
1478
-
// Use the themed colours and ignore inheritance. We do
1479
-
// this so that controls always have the appropriate
1480
-
// background colour (particularly fields).
1481
-
MCPlatformControlType t_control_type;
1482
-
MCPlatformControlPart t_control_part;
1483
-
MCPlatformControlState t_control_state;
1484
-
MCPlatformThemeProperty t_theme_prop;
1485
-
MCPlatformThemePropertyType t_theme_prop_type;
1486
-
if (o->getthemeselectorsforprop(P_BACK_COLOR, t_control_type, t_control_part, t_control_state, t_theme_prop, t_theme_prop_type))
0 commit comments