flex - How to get the negative position value in Group? -
the dashed rectangle parent group , inside, there label. x negative.
now, want relocation outside group contents' top-left point , meanwhile contents' move outside group's (0,0) point. result looks keeps same position before.but in fact, both inside content , outside group moved.
it easy realize in flash, however, in flex got trouble.
the function "getrect" returns wrong values.it's never return correct position inside content is.(like thumb shows,the position should [-70,50])
(feel free correct me because i'm not sure want accomplish here)
if label (let's called mylabel) correctly located directly inside of group, calling mylabel.x return x-coordinate of label compared parent (which group here, should -70).
then if want move label fits group viewport, have 2 solutions:
- either manually set mylabel.x = 0 , mylabel.y = 0. in case label moved @ group origin.
- either retrieve matrix of label component call .translate(dx, dy) function. using matrix functions modify way label displayed, position remain unchanged (more information on page).
short answer: if don't care keeping original position of label, set mylabel.x = 0 , mylabel.y = 0 , should moved correctly.
Comments
Post a Comment