Skip to content

Commit

Permalink
mixins: use inverseAlpha, reset viewportColor
Browse files Browse the repository at this point in the history
  • Loading branch information
Therealnull committed Feb 19, 2021
1 parent 197447f commit 669865d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,7 @@ else if (widget.getType() == WidgetType.RECTANGLE)
int vpc = viewportColor;
int c1 = (alpha * (tc & 0xff00ff) >> 8 & 0xFF00FF) + (alpha * (tc & 0x00FF00) >> 8 & 0x00FF00);
int c2 = (inverseAlpha * (vpc & 0xff00ff) >> 8 & 0xFF00FF) + (inverseAlpha * (vpc & 0x00FF00) >> 8 & 0x00FF00);
int outAlpha = alpha + ((vpc >>> 24) * (255 - alpha) * 0x8081 >>> 23);
int outAlpha = inverseAlpha + ((vpc >>> 24) * (255 - alpha) * 0x8081 >>> 23);
viewportColor = outAlpha << 24 | c1 + c2;
widget.setHidden(true);
hiddenWidgets.add(widget);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ public void onPost(Object canvas)
DrawCallbacks drawCallbacks = client.getDrawCallbacks();
if (drawCallbacks != null)
{
drawCallbacks.draw(-viewportColor);
drawCallbacks.draw(viewportColor);
viewportColor = 0;
}
}

Expand Down

0 comments on commit 669865d

Please sign in to comment.