MCPcopy Create free account
hub / github.com/SolarLune/masterplan / DrawShadow

Method DrawShadow

card.go:1129–1158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1127}
1128
1129func (card *Card) DrawShadow() {
1130
1131 t := time.Now()
1132 defer func() { card.debugDrawTime += time.Since(t) }()
1133
1134 if !globals.Settings.Get(SettingsCardShadows).AsBool() || !card.Onscreen() || (card.VisualDragging && card.PinnedTo != nil && card.PinnedTo.VisualDragging) {
1135 return
1136 }
1137
1138 color := card.Color()
1139
1140 if color[3] > 0 {
1141
1142 tp := card.Page.Project.Camera.TranslatePoint(card.ShadowDisplayPosition)
1143 tp.X += 8
1144 tp.Y += 8
1145
1146 color = color.Mult(0.8).Sub(20)
1147 card.ShadowTexture.SetColorMod(color.RGB())
1148 card.ShadowTexture.SetAlphaMod(192)
1149 globals.Renderer.RenderTexture(card.ShadowTexture, nil, &sdl.FRect{
1150 tp.X,
1151 tp.Y,
1152 card.DisplayRect.W,
1153 card.DisplayRect.H,
1154 })
1155
1156 }
1157
1158}
1159
1160func (card *Card) NearestPointTowardDisplayRectCenter(in Vector) Vector {
1161

Callers 1

DrawMethod · 0.80

Calls 8

OnscreenMethod · 0.95
ColorMethod · 0.95
AsBoolMethod · 0.80
TranslatePointMethod · 0.80
RGBMethod · 0.80
GetMethod · 0.45
SubMethod · 0.45
MultMethod · 0.45

Tested by

no test coverage detected