We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6997940 commit a6c9748Copy full SHA for a6c9748
1 file changed
src/hyperspace/ui.clj
@@ -133,10 +133,15 @@
133
display-y (:y display-point)]
134
(draw-ellipse display-x display-y (normalize-x 5) (normalize-y 5) 30)))
135
136
+(defn space-point-on-display?
137
+ [{x :x, y :y}]
138
+ (and (< 0 x window-width)
139
+ (< 0 y window-height)))
140
+
141
(defn draw-traces
142
[bullet]
143
(GL11/glColor3f 1 1 0)
- (doseq [point (:traces bullet)]
144
+ (doseq [point (filter space-point-on-display? (:traces bullet))]
145
(let [center (space-point-to-display point)
146
{center-x :x center-y :y} center
147
x1 (- center-x (normalize-x 1))
0 commit comments