public static RectStylePainterParameters GetDefault(VisualElement ve) { IStyle style = ve.style; var painterParams = new RectStylePainterParameters { rect = GUIUtility.AlignRectToDevice(ve.rect), color = style.backgroundColor, }; BorderParameters.SetFromStyle(ref painterParams.border, style); return(painterParams); }
public static TextureStylePainterParameters GetDefault(VisualElement ve) { IStyle style = ve.style; var painterParams = new TextureStylePainterParameters { rect = GUIUtility.AlignRectToDevice(ve.rect), uv = new Rect(0, 0, 1, 1), color = (Color)Color.white, texture = style.backgroundImage, scaleMode = style.backgroundScaleMode, sliceLeft = style.sliceLeft, sliceTop = style.sliceTop, sliceRight = style.sliceRight, sliceBottom = style.sliceBottom }; BorderParameters.SetFromStyle(ref painterParams.border, style); return(painterParams); }
public static TextureStylePainterParameters GetDefault(VisualElement ve) { IStyle style = ve.style; var painterParams = new TextureStylePainterParameters { rect = GUIUtility.AlignRectToDevice(ve.rect), uv = new Rect(0, 0, 1, 1), // When the background color is not clear, we have to embed it into the texture... // whereas if the color is clear, the white color is used... color = (style.backgroundColor != Color.clear) ? (Color)style.backgroundColor : (Color)Color.white, texture = style.backgroundImage, scaleMode = style.backgroundScaleMode, sliceLeft = style.sliceLeft, sliceTop = style.sliceTop, sliceRight = style.sliceRight, sliceBottom = style.sliceBottom }; BorderParameters.SetFromStyle(ref painterParams.border, style); return(painterParams); }