diff options
| author | jussi | 2024-04-17 00:35:58 +0300 |
|---|---|---|
| committer | jussi | 2024-04-17 00:35:58 +0300 |
| commit | 70b40f67824b3d612235c382aa83821c054fa51e (patch) | |
| tree | 5d594cc457d6fed8af87e31977a0b9352677a4f5 /examples/raygui_extensions/tree_view.lua | |
| parent | 41b67398247d9031aed4ca6e3ffd6799ec8b1bca (diff) | |
| download | reilua-enhanced-70b40f67824b3d612235c382aa83821c054fa51e.tar.gz reilua-enhanced-70b40f67824b3d612235c382aa83821c054fa51e.tar.bz2 reilua-enhanced-70b40f67824b3d612235c382aa83821c054fa51e.zip | |
Object libraries like Vector2 optimizations.
Diffstat (limited to 'examples/raygui_extensions/tree_view.lua')
| -rw-r--r-- | examples/raygui_extensions/tree_view.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/raygui_extensions/tree_view.lua b/examples/raygui_extensions/tree_view.lua index ac73d4a..055694d 100644 --- a/examples/raygui_extensions/tree_view.lua +++ b/examples/raygui_extensions/tree_view.lua @@ -20,8 +20,8 @@ function TreeView:new( bounds, text, callbacks, styles, tooltip ) object.bounds = bounds:clone() object.text = text - object.scroll = Vec2:new() - object.view = Rect:new() + object.scroll = Vec2:new( 0, 0 ) + object.view = Rect:new( 0, 0, 0, 0 ) object.callbacks = callbacks -- select, grab, drag. object.styles = styles object.tooltip = tooltip @@ -269,7 +269,7 @@ function TreeView:itemSelect( item ) end function TreeView:update() - local mousePos = Vec2:new( RL.GetMousePosition() ) + local mousePos = Vec2:newT( RL.GetMousePosition() ) local guiMousePos = mousePos + self.gui.mouseOffset local mouseInView = self.view:checkCollisionPoint( mousePos ) @@ -336,8 +336,8 @@ end function TreeView:draw() local oldScroll = self.scroll:clone() local _, scroll, view = RL.GuiScrollPanel( self.bounds, self.text, self.content, self.scroll, self.view ) - self.view:set( view ) - self.scroll:set( scroll ) + self.view:setT( view ) + self.scroll:setT( scroll ) if self.scroll ~= oldScroll or self._forceCheckScroll then if not self._forceCheckScroll then @@ -386,7 +386,7 @@ function TreeView:setSize( size ) self.defaultControlSize = Vec2:new( self.content.width, self.defaultControlHeight ) local _, _, view = RL.GuiScrollPanel( self.bounds, self.text, self.content, self.scroll, self.view ) - self.view = Rect:new( view ) + self.view = Rect:newT( view ) self.gui.view = Rect:new( 0, 0, self.view.width, self.view.height ) self.framebufferSize = Vec2:new( self.bounds.width, self.bounds.height - self.gui.RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT ) |
