public static RectStylePainterParameters GetDefault(VisualElement ve) { ComputedStyle style = ve.computedStyle; var painterParams = new RectStylePainterParameters { rect = GUIUtility.AlignRectToDevice(ve.rect), color = style.backgroundColor.value, }; BorderParameters.SetFromStyle(ref painterParams.border, style); return(painterParams); }
public static TextureStylePainterParameters GetDefault(VisualElement ve) { ComputedStyle style = ve.computedStyle; var painterParams = new TextureStylePainterParameters { rect = GUIUtility.AlignRectToDevice(ve.rect), uv = new Rect(0, 0, 1, 1), color = (Color)Color.white, texture = style.backgroundImage.value.texture, scaleMode = style.unityBackgroundScaleMode.value, sliceLeft = style.unitySliceLeft.value, sliceTop = style.unitySliceTop.value, sliceRight = style.unitySliceRight.value, sliceBottom = style.unitySliceBottom.value }; BorderParameters.SetFromStyle(ref painterParams.border, style); return(painterParams); }