TreeView fix.
This commit is contained in:
4
devnotes
4
devnotes
@@ -3,8 +3,7 @@ Current {
|
|||||||
|
|
||||||
Backlog {
|
Backlog {
|
||||||
* Raygui
|
* Raygui
|
||||||
* Icon enums.
|
* Set callbacks to single table.
|
||||||
* Set callbacks to single table?
|
|
||||||
* Raygui lib
|
* Raygui lib
|
||||||
* Check if could remove flickering from changing draw order by making queue for order
|
* Check if could remove flickering from changing draw order by making queue for order
|
||||||
changing and only change them after everything is drawn.
|
changing and only change them after everything is drawn.
|
||||||
@@ -20,7 +19,6 @@ Backlog {
|
|||||||
* Improve Dungeon crawler example by generating custom mesh instead of drawing 3D quads.
|
* Improve Dungeon crawler example by generating custom mesh instead of drawing 3D quads.
|
||||||
* Platformer example physics update for true framerate independence.
|
* Platformer example physics update for true framerate independence.
|
||||||
* Android support
|
* Android support
|
||||||
* Godot scene importer lib.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Bugs {
|
Bugs {
|
||||||
|
|||||||
@@ -249,7 +249,6 @@ end
|
|||||||
local function addTreeView()
|
local function addTreeView()
|
||||||
TreeView = Gui:TreeView(
|
TreeView = Gui:TreeView(
|
||||||
Rect:new( 600, 20, 256, 328 ),
|
Rect:new( 600, 20, 256, 328 ),
|
||||||
-- Rect:new( 600, 20, 256, 600 ),
|
|
||||||
"Tree View",
|
"Tree View",
|
||||||
function( controls ) selected( controls ) end, -- Callback.
|
function( controls ) selected( controls ) end, -- Callback.
|
||||||
function( self ) Gui:set2Top( self ) end, -- Grab callback.
|
function( self ) Gui:set2Top( self ) end, -- Grab callback.
|
||||||
|
|||||||
@@ -197,7 +197,6 @@ function TreeView:itemSelect( item )
|
|||||||
|
|
||||||
for i = #self.selectedItems, 1, -1 do
|
for i = #self.selectedItems, 1, -1 do
|
||||||
local moveItem = self.selectedItems[i]
|
local moveItem = self.selectedItems[i]
|
||||||
-- print( moveItem.text, "moveItem._id", moveItem._id, item.text, "item._id", item._id )
|
|
||||||
|
|
||||||
if moveItem ~= item and not self:isChild( moveItem, item ) then
|
if moveItem ~= item and not self:isChild( moveItem, item ) then
|
||||||
local parentControls = self.controls
|
local parentControls = self.controls
|
||||||
@@ -206,13 +205,7 @@ function TreeView:itemSelect( item )
|
|||||||
parentControls = moveItem._parent.controls
|
parentControls = moveItem._parent.controls
|
||||||
end
|
end
|
||||||
|
|
||||||
local pos = #self.selectedItems - i + 1
|
table.insert( moveItems, table.remove( parentControls, moveItem._childId ) )
|
||||||
|
|
||||||
if moveItem._parent == item._parent and moveItem._childId < item._childId then
|
|
||||||
pos = 1
|
|
||||||
end
|
|
||||||
|
|
||||||
table.insert( moveItems, pos, table.remove( parentControls, moveItem._childId ) )
|
|
||||||
end
|
end
|
||||||
|
|
||||||
moveItem.active = false
|
moveItem.active = false
|
||||||
@@ -228,7 +221,7 @@ function TreeView:itemSelect( item )
|
|||||||
local offset = 0
|
local offset = 0
|
||||||
|
|
||||||
if moveItem._parent == item._parent and moveItem._childId < item._childId then
|
if moveItem._parent == item._parent and moveItem._childId < item._childId then
|
||||||
offset = -1
|
offset = -#moveItems
|
||||||
end
|
end
|
||||||
|
|
||||||
if self._movingItem == self.MOVE_ITEM_IN then
|
if self._movingItem == self.MOVE_ITEM_IN then
|
||||||
@@ -270,7 +263,7 @@ function TreeView:itemSelect( item )
|
|||||||
end
|
end
|
||||||
|
|
||||||
if self.callback ~= nil then
|
if self.callback ~= nil then
|
||||||
self.callback( self.selectedItems )
|
-- self.callback( self.selectedItems )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user