Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
color = self.node.color if not self.change else (255, 100, 10)
# codeEditor background
quad_aligned(l.x - layout_padding, l.y,
l.width + layout_padding, l.height,
((0, 0, 0) if not self.change
else (20, 10, 5)) + (230,))
if self.resize:
quad_aligned(l.x - layout_padding, l.y + l.height,
self.node.editor_size[0] + layout_padding,
-self.node.editor_size[1],
color + (100,))
# codeEditor resize corner
quad_aligned(l.x + l.width - resize_button, l.y,
resize_button, resize_button, color + (255,))
# codeEditor left line
quad_aligned(l.x - layout_padding - nline_width, l.y,
nline_width, l.height, color + (255,))
# codeEditor left line numbering
font_height = self.layout.content_height / self.layout.get_line_count()
line_offset = (-self.layout.view_y) % font_height
first_line = int(-self.layout.view_y / font_height)
count_line = min(int((self.layout.height + line_offset) / font_height), self.layout.get_line_count())
self.line_numbering.x = l.x - layout_padding - nline_width - nline_padding
self.line_numbering.y = l.y + l.height + line_offset
self.line_numbering.text = '\n'.join(['%02i'%i for i in range(first_line + 1, first_line + count_line + 1)])
self.line_numbering.draw()
if self.hover:
if self.document.text and not self.hovered:
self.hovered = True
self.update_highlighting()
color = self.node.color if not self.change else (255, 100, 10)
# codeEditor background
quad_aligned(l.x - layout_padding, l.y,
l.width + layout_padding, l.height,
((0, 0, 0) if not self.change
else (20, 10, 5)) + (230,))
if self.resize:
quad_aligned(l.x - layout_padding, l.y + l.height,
self.node.editor_size[0] + layout_padding,
-self.node.editor_size[1],
color + (100,))
# codeEditor resize corner
quad_aligned(l.x + l.width - resize_button, l.y,
resize_button, resize_button, color + (255,))
# codeEditor left line
quad_aligned(l.x - layout_padding - nline_width, l.y,
nline_width, l.height, color + (255,))
# codeEditor left line numbering
font_height = self.layout.content_height / self.layout.get_line_count()
line_offset = (-self.layout.view_y) % font_height
first_line = int(-self.layout.view_y / font_height)
l.width + layout_padding, l.height,
((0, 0, 0) if not self.change
else (20, 10, 5)) + (230,))
if self.resize:
quad_aligned(l.x - layout_padding, l.y + l.height,
self.node.editor_size[0] + layout_padding,
-self.node.editor_size[1],
color + (100,))
# codeEditor resize corner
quad_aligned(l.x + l.width - resize_button, l.y,
resize_button, resize_button, color + (255,))
# codeEditor left line
quad_aligned(l.x - layout_padding - nline_width, l.y,
nline_width, l.height, color + (255,))
# codeEditor left line numbering
font_height = self.layout.content_height / self.layout.get_line_count()
line_offset = (-self.layout.view_y) % font_height
first_line = int(-self.layout.view_y / font_height)
count_line = min(int((self.layout.height + line_offset) / font_height), self.layout.get_line_count())
self.line_numbering.x = l.x - layout_padding - nline_width - nline_padding
self.line_numbering.y = l.y + l.height + line_offset
self.line_numbering.text = '\n'.join(['%02i'%i for i in range(first_line + 1, first_line + count_line + 1)])
self.line_numbering.draw()
# codeEditor autocomplete hint
self.autocomplete.x = l.x
self.autocomplete.y = l.y + l.height + help_offset
self.autocomplete.draw()
l.y = self.node.y - l.height + self.node.ch + y_shift
if self.change:
self.update_label.x = l.x
self.update_label.y = l.y - help_offset
self.update_label.draw()
if self.hover:
if self.document.text and not self.hovered:
self.hovered = True
self.update_highlighting()
color = self.node.color if not self.change else (255, 100, 10)
# codeEditor background
quad_aligned(l.x - layout_padding, l.y,
l.width + layout_padding, l.height,
((0, 0, 0) if not self.change
else (20, 10, 5)) + (230,))
if self.resize:
quad_aligned(l.x - layout_padding, l.y + l.height,
self.node.editor_size[0] + layout_padding,
-self.node.editor_size[1],
color + (100,))
# codeEditor resize corner
quad_aligned(l.x + l.width - resize_button, l.y,
resize_button, resize_button, color + (255,))
# codeEditor left line
quad_aligned(l.x - layout_padding - nline_width, l.y,