internal static RectStylePainterParameters GetDefaultRectParameters(this IStylePainter painter, VisualElement ve) { IStyle style = ve.style; RectStylePainterParameters result = new RectStylePainterParameters { rect = ve.rect, color = style.backgroundColor }; painter.SetBorderFromStyle(ref result.border, style); return(result); }
internal static RectStylePainterParameters GetDefaultRectParameters(this IStylePainter painter, VisualElement ve) { IStyle style = ve.style; var painterParams = new RectStylePainterParameters { rect = ve.alignedRect, color = style.backgroundColor, }; painter.SetBorderFromStyle(ref painterParams.border, style); return(painterParams); }
internal static TextureStylePainterParameters GetDefaultTextureParameters(this IStylePainter painter, VisualElement ve) { IStyle style = ve.style; TextureStylePainterParameters result = new TextureStylePainterParameters { rect = ve.rect, uv = new Rect(0f, 0f, 1f, 1f), color = Color.white, texture = style.backgroundImage, scaleMode = style.backgroundSize, sliceLeft = style.sliceLeft, sliceTop = style.sliceTop, sliceRight = style.sliceRight, sliceBottom = style.sliceBottom }; painter.SetBorderFromStyle(ref result.border, style); return(result); }