MCPcopy Index your code
hub / github.com/JacquesLucke/code_autocomplete / draw_rectangle

Function draw_rectangle

graphics.py:4–12  ·  view source on GitHub ↗
(rectangle, color = (0.8, 0.8, 0.8, 1.0))

Source from the content-addressed store, hash-verified

2from bgl import glBegin, glVertex2f, glEnd, GL_POLYGON, glEnable, glDisable, GL_POLYGON_SMOOTH, GL_BLEND, glColor4f, GL_LINE_STRIP, glLineWidth, GL_LINES, glViewport
3
4def draw_rectangle(rectangle, color = (0.8, 0.8, 0.8, 1.0)):
5 glColor4f(*color)
6 glEnable(GL_BLEND)
7 glBegin(GL_POLYGON)
8 glVertex2f(rectangle.left, rectangle.top)
9 glVertex2f(rectangle.right, rectangle.top)
10 glVertex2f(rectangle.right, rectangle.bottom)
11 glVertex2f(rectangle.left, rectangle.bottom)
12 glEnd()
13
14def draw_rectangle_border(rectangle, thickness = 1, color = (0.1, 0.1, 0.1, 1.0)):
15 glColor4f(*color)

Callers 5

draw_operator_boxMethod · 0.85
draw_description_boxMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected