mirror of
https://github.com/csd4ni3l/browser.git
synced 2026-01-01 04:03:43 +01:00
fix crashing if a click happened before rendering
This commit is contained in:
@@ -247,6 +247,7 @@ class Renderer():
|
|||||||
self.scroll_y_speed = 50
|
self.scroll_y_speed = 50
|
||||||
self.allow_scroll = False
|
self.allow_scroll = False
|
||||||
self.smallest_y = 0
|
self.smallest_y = 0
|
||||||
|
self.document = None
|
||||||
|
|
||||||
self.widgets: list[pyglet.text.Label] = []
|
self.widgets: list[pyglet.text.Label] = []
|
||||||
self.text_to_create = []
|
self.text_to_create = []
|
||||||
@@ -286,6 +287,9 @@ class Renderer():
|
|||||||
self.hide_out_of_bounds_labels()
|
self.hide_out_of_bounds_labels()
|
||||||
|
|
||||||
def on_mouse_press(self, x: int, y: int, button: int, modifiers: int):
|
def on_mouse_press(self, x: int, y: int, button: int, modifiers: int):
|
||||||
|
if not self.document:
|
||||||
|
return
|
||||||
|
|
||||||
y -= self.scroll_y
|
y -= self.scroll_y
|
||||||
|
|
||||||
objs = [
|
objs = [
|
||||||
|
|||||||
Reference in New Issue
Block a user