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

Method Draw

selection.go:101–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

99}
100
101func (selection *Selection) Draw() {
102 if selection.BoxSelecting {
103 globals.Renderer.SetScale(1, 1)
104 unprojected := selection.Page.Project.Camera.UntranslatePoint(selection.BoxStart)
105 unprojected = unprojected.Mult(globals.Project.Camera.Zoom).Rounded()
106 other := globals.Mouse.Position().Rounded()
107 boxColor := getThemeColor(GUIMenuColor)
108
109 oxuy := Vector{
110 other.X,
111 unprojected.Y,
112 }
113
114 uxoy := Vector{
115 unprojected.X,
116 other.Y,
117 }
118
119 t := float32(5)
120
121 for i := 0; i < 2; i++ {
122 ThickLine(unprojected, oxuy, t, boxColor)
123 ThickLine(unprojected, uxoy, t, boxColor)
124 ThickLine(oxuy, other, t, boxColor)
125 ThickLine(uxoy, other, t, boxColor)
126
127 boxColor = getThemeColor(GUIFontColor)
128
129 t = 4
130 }
131
132 }
133}

Callers

nothing calls this directly

Calls 6

getThemeColorFunction · 0.85
ThickLineFunction · 0.85
UntranslatePointMethod · 0.80
RoundedMethod · 0.80
MultMethod · 0.45
PositionMethod · 0.45

Tested by

no test coverage detected