MCPcopy Create free account
hub / github.com/cogentcore/core / TestBoxShadow

Function TestBoxShadow

paint/boxmodel_test.go:36–54  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

34}
35
36func TestBoxShadow(t *testing.T) {
37 RunTest(t, "boxshadow", 300, 300, func(pc *Context) {
38 pabg := colors.Uniform(colors.White)
39 s := styles.NewStyle()
40 s.Color = colors.Uniform(colors.Black)
41 s.Background = colors.Uniform(colors.Lightblue)
42 s.Border.Style.Set(styles.BorderSolid)
43 s.Border.Width.Set(units.Dp(0))
44 s.Border.Color.Set(colors.Uniform(colors.Red))
45 s.Border.Radius = styles.BorderRadiusFull
46 s.BoxShadow = styles.BoxShadow1()
47 s.ComputeActualBackground(pabg)
48 s.ToDots()
49
50 sz := s.BoxSpace().Size().Add(math32.Vec2(200, 100))
51
52 pc.DrawStandardBox(s, math32.Vec2(50, 100), sz, pabg)
53 })
54}
55
56func TestActualBackgroundColor(t *testing.T) {
57 RunTest(t, "actual-background-color", 300, 300, func(pc *Context) {

Callers

nothing calls this directly

Calls 13

ToDotsMethod · 0.95
BoxSpaceMethod · 0.95
UniformFunction · 0.92
NewStyleFunction · 0.92
DpFunction · 0.92
BoxShadow1Function · 0.92
Vec2Function · 0.92
RunTestFunction · 0.85
DrawStandardBoxMethod · 0.80
SetMethod · 0.65
AddMethod · 0.65

Tested by

no test coverage detected