From c460e3c9791ab1fe36d90b6d78aa8633e15ce753 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 17 Nov 2010 18:59:39 +0900 Subject: [PATCH] Fix setBasePos to get the pos from a view. This fixes Group for the Point/Size/Rect change. --- ruamoko/gui/Group.r | 3 ++- ruamoko/gui/View.r | 11 +++++++++-- ruamoko/include/gui/View.h | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ruamoko/gui/Group.r b/ruamoko/gui/Group.r index 3f02fadd5..4e5f41b4b 100644 --- a/ruamoko/gui/Group.r +++ b/ruamoko/gui/Group.r @@ -41,7 +41,8 @@ { [super setBasePos:pos]; local Point point = {xabs, yabs}; - [views makeObjectsPerformSelector:@selector (setBasePos:) withObject:point]; + local SEL sel = @selector (setBasePosFromView:); + [views makeObjectsPerformSelector:sel withObject:self]; } - (void) draw diff --git a/ruamoko/gui/View.r b/ruamoko/gui/View.r index c3405331f..c713cccb8 100644 --- a/ruamoko/gui/View.r +++ b/ruamoko/gui/View.r @@ -38,14 +38,21 @@ return flags & 1; } +- (Point) basePos +{ + return makePoint (xabs, yabs); +} + - (void) setBasePos: (integer) x y: (integer) y { local Point point = {x, y}; - [self setBasePos:point]; + xabs = xpos + x; + yabs = ypos + y; } -- (void) setBasePos: (Point)pos +- (void) setBasePosFromView: (View) view { + Point pos = [view basePos]; xabs = xpos + pos.x; yabs = ypos + pos.y; } diff --git a/ruamoko/include/gui/View.h b/ruamoko/include/gui/View.h index 741a820f6..7626eeac5 100644 --- a/ruamoko/include/gui/View.h +++ b/ruamoko/include/gui/View.h @@ -20,7 +20,7 @@ - (id) canFocus: (integer)cf; - (integer) canFocus; - (void) setBasePos: (integer)x y: (integer)y; -- (void) setBasePos: (Point)pos; +- (void) setBasePosFromView: (View)view; - (void) draw; - (integer) keyEvent:(integer)key unicode:(integer)unicode down:(integer)down;