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

Function TestBoxModel

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

Source from the content-addressed store, hash-verified

16)
17
18func TestBoxModel(t *testing.T) {
19 RunTest(t, "boxmodel", 300, 300, func(pc *Context) {
20 pabg := colors.Uniform(colors.White)
21 s := styles.NewStyle()
22 s.Color = colors.Uniform(colors.Black)
23 s.Background = colors.Uniform(colors.Lightblue)
24 s.Border.Style.Set(styles.BorderSolid)
25 s.Border.Width.Set(units.Dp(5))
26 s.Border.Color.Set(colors.Uniform(colors.Red))
27 s.Border.Radius = styles.BorderRadiusFull
28 s.ComputeActualBackground(pabg)
29 s.ToDots()
30
31 sz := s.BoxSpace().Size().Add(math32.Vec2(200, 100))
32 pc.DrawStandardBox(s, math32.Vec2(50, 100), sz, pabg)
33 })
34}
35
36func TestBoxShadow(t *testing.T) {
37 RunTest(t, "boxshadow", 300, 300, func(pc *Context) {

Callers

nothing calls this directly

Calls 12

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

Tested by

no test coverage detected