STR #3432

GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features ]

STR #3432

Application:FLTK Library
Status:1 - Closed w/Resolution
Priority:2 - Low, e.g. a documentation error or undocumented side-effect
Scope:3 - Applies to all machines and operating systems
Subsystem:Core Library
Summary:Fl_Tree with FL_TREE_SELECT_SINGLE_DRAGGABLE Drops Into Wrong Place
Version:1.4.0
Created By:sanch
Assigned To:greg.ercolano
Fix Version:1.4.0
Fix Commit:0d329a4
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:


Name/Time/Date Filename/Size top right image
 
#1 sanch
12:20 Nov 10, 2017
fl_tree.diff
0k
 
bottom left image   bottom right image

Trouble Report Comments:


Name/Time/Date Text top right image
 
#1 sanch
12:20 Nov 10, 2017
When dropping an item into the first position after an open folder, the item inserts ABOVE the folder incorrectly.

This only occurs when the pointer is above the drawn line when the pointer is released. If the pointer is below the drawn line when released, the dragged item inserts correctly.

Review of Fl_Tree::handle() code for FL_RELEASE shows detection of special case of dropping before an open folder, but then falls through into normal above/below positioning code. This is where the wrong location to drop gets selected.

See attached diff for a fix that works for me. The diff is from svn fltk-1.4.x-r12548.

This problem also exists in 1.3.4
 
 
#2 greg.ercolano
09:36 Aug 27, 2019
To replicate, apparently one must drag an item UPWARDS from a position lower than the new destination.

If one drags an item DOWNWARD from a higher position in the tree, the bug doesn't happen.

So to replicate the bug in the test/tree program (1.4.x):

    1) Open test/tree
    2) Change "Selection Mode:" to Single+drag
    3) Under ROOT->Bbb->child-01:
          a) Click and hold on '333'
          b) Drag it upwards and hover over the "Child-01" label
          c) Release mouse button to drop

Result is the '333' item ends up one level above the folder instead of inside it at the top.



Interestingly, if you try dragging an item that is higher up the tree downward using the same technique, it works fine, e.g.

    1) Click the 'Aaa' item
    2) Drag it DOWNWARD and hover over the 'child-01' label
    3) Release the mouse button to drop

..that works fine, no matter where the "draw-line" is.
 
 
#3 greg.ercolano
16:42 Aug 27, 2019
Should be fixed in commit 0d329a4.  
 
#4 greg.ercolano
16:57 Aug 27, 2019
Fixed in Git repository.

Closing this as solved; if the problem persists, please request to reopen
on fltk.general, or make a new STR if behavior is different
 
bottom left image   bottom right image

Return to Bugs & Features ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2021 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.