Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 384024

Summary: [Grid] refactor GridItem.js to calculate position based on pixel offset, not flat index
Product: [RT] RAP Reporter: Tim Buschtoens <tbuschto>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: tbuschto
Version: 1.5   
Target Milestone: 2.0 M1   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 383524    

Description Tim Buschtoens CLA 2012-07-02 06:29:14 EDT
The GridItem.js has three public methods used for position calculation:

* getVisibleChildrenCount
* findItemByFlatIndex
and 
* getFlatIndex

These should be changed to be based on the virtual pixel offset of the item instead of the flat index. This will allow the implementation of items with custom heights. 
"findItemByFlatIndex" will become "findItemByOffset", and "getFlatIndex" will become "getOffset".

"getVisibleChildrenCount" will probably remain, but a new methods "getItemHeight( includeChildren )" migh be introduced.
Comment 1 Tim Buschtoens CLA 2012-07-03 10:40:28 EDT
Fixed with commit e2861da9f7055a1f2fd6f0f0f30726e09fc12255.

"findItemByFlatIndex" was replaced by "findItemByOffset"
"getOffset" was implemented in addition to "getFlatIndex"
Also added "getOffsetHeight" (item height including children if expanded) and "getOwnHeight" (item height excluding children).
Comment 2 Tim Buschtoens CLA 2012-07-03 10:55:45 EDT
Reverted changes (commit 74394fbb56e323584e5abb0ee5ec74f32a94b838). I broke GridTest.js
Comment 3 Tim Buschtoens CLA 2012-07-03 12:25:46 EDT
Fixed again with commit 8cd244f10e201ff9e28267f32bb2bf04aafa655d.

Tests did not fully run the first time. There was a bug when the very first item was expanded.