Status: New Owner: ---- Labels: Type-Defect Priority-Medium
New issue 830 by google....@ben.coman.com.au: ROLabel dynamic text not updating bounds/ROBorder properly http://code.google.com/p/moose-technology/issues/detail?id=830
The code below results in the image attached, where you can see the ROBorder does not encompass the text. The border should probably expand to encompass dynamically changing shapes. but not necessarily since you may want to have a border only around the label with the children having no border. The symptom is more that the width is inconsistent between each of the text nodes.
----------------- | view rawView node1 node2 node3 node4 | rawView := ROView new. view := ROMondrianViewBuilder view: rawView.
node1 := ROElement new . node1 model: 'node1'. node1 addShape: ROBorder. node1 addShape: (ROLabel text: [ 'node1 ' , node1 bounds extent asString, ' ', node1 bounds asString ] ). node1 addInteraction: RODraggable. rawView add: node1. node2 := ROElement new . node2 model: 'node2'. node2 addShape: ROBorder. node2 addShape: (ROLabel text: [ 'node2 ', String crlf, node2 bounds extent asString, ' ', node2 bounds asString ] ). node2 addInteraction: RODraggable. rawView add: node2.
node3 := ROElement new . node3 model: 'node3'. node3 addShape: ROBorder. node3 addShape: (ROLabel text: [ 'node3 ', String crlf, node3 bounds extent asString, String crlf, node3 bounds asString ] ). node3 addInteraction: RODraggable. rawView add: node3.
node4 := ROElement spriteOn: 'node4' . node4 addShape: (ROLabel text: [ 'node4 ', String crlf, node4 bounds extent asString, String crlf, String crlf, node4 bounds asString ] ). node4 addInteraction: RODraggable. rawView add: node4.
ROVerticalLineLayout on: rawView elements.
ROEaselMorphic new populateMenuOn: view. view noLayout. view open
This is Moose4.7 with Roassal.283 on Windows 7.
Attachments: ROBorder does not encompass ROLabel text.png 17.6 KB
In addition to logging this issue, I am curious why dragging node4 moves twice as fast as the other 3 nodes. I could not trace it back.
moose-technology@googlecode.com wrote:
Status: New Owner: ---- Labels: Type-Defect Priority-Medium
New issue 830 by google....@ben.coman.com.au: ROLabel dynamic text not updating bounds/ROBorder properly http://code.google.com/p/moose-technology/issues/detail?id=830
The code below results in the image attached, where you can see the ROBorder does not encompass the text. The border should probably expand to encompass dynamically changing shapes. but not necessarily since you may want to have a border only around the label with the children having no border. The symptom is more that the width is inconsistent between each of the text nodes.
| view rawView node1 node2 node3 node4 | rawView := ROView new. view := ROMondrianViewBuilder view: rawView.
node1 := ROElement new . node1 model: 'node1'. node1 addShape: ROBorder. node1 addShape: (ROLabel text: [ 'node1 ' , node1 bounds extent
asString, ' ', node1 bounds asString ] ). node1 addInteraction: RODraggable. rawView add: node1.
node2 := ROElement new . node2 model: 'node2'. node2 addShape: ROBorder. node2 addShape: (ROLabel text: [ 'node2 ', String crlf, node2
bounds extent asString, ' ', node2 bounds asString ] ). node2 addInteraction: RODraggable. rawView add: node2.
node3 := ROElement new . node3 model: 'node3'. node3 addShape: ROBorder. node3 addShape: (ROLabel text: [ 'node3 ', String crlf, node3
bounds extent asString, String crlf, node3 bounds asString ] ). node3 addInteraction: RODraggable. rawView add: node3.
node4 := ROElement spriteOn: 'node4' . node4 addShape: (ROLabel text: [ 'node4 ', String crlf, node4
bounds extent asString, String crlf, String crlf, node4 bounds asString ] ). node4 addInteraction: RODraggable. rawView add: node4.
ROVerticalLineLayout on: rawView elements.
ROEaselMorphic new populateMenuOn: view. view noLayout. view open
This is Moose4.7 with Roassal.283 on Windows 7.
Attachments: ROBorder does not encompass ROLabel text.png 17.6 KB
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Hi Ben,
The reason is that node4 is a sprite, i.e., an draggable ROElement with a red border. Since you add the interaction for a second time, node4 is dragged 2 times faster.
Remove the line "node4 addInteraction: RODraggable."
Alexandre
On Sep 3, 2012, at 12:20 PM, Ben Coman btc@openInWorld.com wrote:
In addition to logging this issue, I am curious why dragging node4 moves twice as fast as the other 3 nodes. I could not trace it back.
moose-technology@googlecode.com wrote:
Status: New Owner: ---- Labels: Type-Defect Priority-Medium
New issue 830 by google....@ben.coman.com.au: ROLabel dynamic text not updating bounds/ROBorder properly http://code.google.com/p/moose-technology/issues/detail?id=830
The code below results in the image attached, where you can see the ROBorder does not encompass the text. The border should probably expand to encompass dynamically changing shapes. but not necessarily since you may want to have a border only around the label with the children having no border. The symptom is more that the width is inconsistent between each of the text nodes.
| view rawView node1 node2 node3 node4 | rawView := ROView new. view := ROMondrianViewBuilder view: rawView.
node1 := ROElement new . node1 model: 'node1'. node1 addShape: ROBorder. node1 addShape: (ROLabel text: [ 'node1 ' , node1 bounds extent asString, ' ', node1 bounds asString ] ). node1 addInteraction: RODraggable. rawView add: node1. node2 := ROElement new . node2 model: 'node2'. node2 addShape: ROBorder. node2 addShape: (ROLabel text: [ 'node2 ', String crlf, node2 bounds extent asString, ' ', node2 bounds asString ] ). node2 addInteraction: RODraggable. rawView add: node2.
node3 := ROElement new . node3 model: 'node3'. node3 addShape: ROBorder. node3 addShape: (ROLabel text: [ 'node3 ', String crlf, node3 bounds extent asString, String crlf, node3 bounds asString ] ). node3 addInteraction: RODraggable. rawView add: node3.
node4 := ROElement spriteOn: 'node4' . node4 addShape: (ROLabel text: [ 'node4 ', String crlf, node4 bounds extent asString, String crlf, String crlf, node4 bounds asString ] ). node4 addInteraction: RODraggable. rawView add: node4.
ROVerticalLineLayout on: rawView elements. ROEaselMorphic new populateMenuOn: view. view noLayout. view open
This is Moose4.7 with Roassal.283 on Windows 7.
Attachments: ROBorder does not encompass ROLabel text.png 17.6 KB
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Comment #1 on issue 830 by google....@ben.coman.com.au: ROLabel dynamic text not updating bounds/ROBorder properly http://code.google.com/p/moose-technology/issues/detail?id=830
image updated
Attachments: ROBorder does not encompass ROLabel text.png 19.8 KB
Updates: Labels: Component-Roassal
Comment #2 on issue 830 by alexandr...@gmail.com: ROLabel dynamic text not updating bounds/ROBorder properly http://code.google.com/p/moose-technology/issues/detail?id=830
Well spotted Ben! I've added ROLabelTest>>testDynamicBounds to crystalize the problem
Comment #3 on issue 830 by google....@ben.coman.com.au: ROLabel dynamic text not updating bounds/ROBorder properly http://code.google.com/p/moose-technology/issues/detail?id=830
Thanks Alex. But hold your breath and get a load of the next one. Could be a curly one :) That might require some deep changes - but I think it is somewhat critical, at least for what I was trying to achieve with ROCircleLayout, which is to have elements to pin different corners of themselves to the circle depending on which quadrant they are in.
cheers -ben
Comment #4 on issue 830 by alexandr...@gmail.com: ROLabel dynamic text not updating bounds/ROBorder properly http://code.google.com/p/moose-technology/issues/detail?id=830
Fixed in Roassal 1.109.
However, your example will not work. The reason is that in your block provided to #text: you use #bounds. And you should not since #bounds use #text to compute its bounds. It simply loops.
Try with the following example: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | view el | view := ROView new.
el := ROElement new + ROBorder red. el @ RODraggable. el + (ROLabel text: [ :v | v position asString ]).
view add: el.
view open -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Updates: Status: Fixed
Comment #5 on issue 830 by alexandr...@gmail.com: ROLabel dynamic text not updating bounds/ROBorder properly http://code.google.com/p/moose-technology/issues/detail?id=830
(No comment was entered for this change.)
Updates: Labels: Milestone-4.7
Comment #6 on issue 830 by tu...@tudorgirba.com: ROLabel dynamic text not updating bounds/ROBorder properly http://code.google.com/p/moose-technology/issues/detail?id=830
(No comment was entered for this change.)
Ben, I think I fixed the problem. http://code.google.com/p/moose-technology/issues/detail?id=830
However, your example will not work. The reason is that in your block provided to #text: you use #bounds. And you should not since #bounds use #text to compute its bounds. It simply loops.
Try with the following example: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | view el | view := ROView new.
el := ROElement new + ROBorder red. el @ RODraggable. el + (ROLabel text: [ :v | v position asString ]).
view add: el.
view open -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Let me know how it goes.
I will look at the Circle problem soon.
Cheers, Alexandre
On Sep 4, 2012, at 12:41 PM, moose-technology@googlecode.com wrote:
Comment #3 on issue 830 by google....@ben.coman.com.au: ROLabel dynamic text not updating bounds/ROBorder properly http://code.google.com/p/moose-technology/issues/detail?id=830
Thanks Alex. But hold your breath and get a load of the next one. Could be a curly one :) That might require some deep changes - but I think it is somewhat critical, at least for what I was trying to achieve with ROCircleLayout, which is to have elements to pin different corners of themselves to the circle depending on which quadrant they are in.
cheers -ben
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Thanks Alexandre. You probably already know what I present here, but I got curious about how the recursion was occurring (another chance to learn more digging into the system) and I learn better if I have to get it down in writing. I also have a fix if the overhead was acceptable.
I have the impression that your fix is rather complicated. Without trying to understand why it is so important to have a label that tells the size of itself, you could simply have:
-=--=-=--=-=--=-=--=-=--= "Preambule. It includes the initialization. " | rawView view node innerNode | rawView := ROView new. view := ROMondrianViewBuilder view: rawView. "enter your script below" "-------------" "-------------"
node := view node: 'foo'. innerNode := ROElement new + (ROLabel text: [ :v | node bounds]). innerNode @ RODraggable. node on: ROMouseDragging do: [ :ann | ROAdjustSizeOfNesting on: node ]. node add: innerNode. ROAdjustSizeOfNesting on: node.
"-------------" "-------------" "Below is the initiation of the menu and opening the visualization" ROEaselMorphic new populateMenuOn: view. view open -=--=-=--=-=--=-=--=-=--=
A label inside tells the size of its owner. Thus breaking the egg-chicken recursion.
The attachment shows recursion starting at ROLabel>>extentFor:. You can see the rough fix I implemented. (Note the snapshot is from after I implemented the fix, so for this snapshot I cheated and manually forced (blockRecurion:=nil) in the debugger for one step.) btw, to find the right place to debug for the recursion without locking up the system, I used the following Workspace code. The whole thing needs to be executed in one go so that the context of the 'xx' variable is the same throughout.
Using thread in that way is dangerous :-)
Alexandre