public override void Draw(DrawingContext drawingContext, float scale, float x, float y) { base.Draw(drawingContext, scale, x, y); float padding = TEXConfiguration.main.LinkMargin; var tint = drawingContext.DrawLink( new Rect((x - padding / 2f) * scale, (y - depth - padding / 2f) * scale, (width + padding) * scale, (totalHeight + padding) * scale), metaKey); TexContext.Color.Push(TexUtility.MultiplyColor(TexContext.Color.value, tint)); baseBox.Draw(drawingContext, scale, x, y); TexContext.Color.Pop(); }
public override void Draw(DrawingContext drawingContext, float scale, float x, float y) { base.Draw(drawingContext, scale, x, y); float padding = TEXConfiguration.main.LinkMargin; var tint = drawingContext.DrawLink( new Rect((x - padding / 2f) * scale, (y - depth - padding / 2f) * scale, (width + padding) * scale, (totalHeight + padding) * scale), metaKey); if (tint == TexUtility.white) { baseBox.Draw(drawingContext, scale, x, y); } else { var oldColor = TexUtility.RenderColor; var newColor = TexUtility.MultiplyColor(oldColor, tint); TexUtility.RenderColor = newColor; baseBox.Draw(drawingContext, scale, x, y); TexUtility.RenderColor = oldColor; } }