From: Agnelo Vaz Date: Wed, 1 Apr 2015 12:53:15 +0000 (+0100) Subject: Fixes to Text after Size Negotiation X-Git-Tag: dali_1.0.38~11^2~19 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=837f9dc1227e31a25d33ce5eba4c8dc7520ae67a Fixes to Text after Size Negotiation Change-Id: I259ff6f23056e587654818d415818e4c7ad7517b Signed-off-by: Agnelo Vaz --- diff --git a/dali-toolkit/internal/text/clipping/text-clipper.cpp b/dali-toolkit/internal/text/clipping/text-clipper.cpp index b2478e4..92dbaa4 100644 --- a/dali-toolkit/internal/text/clipping/text-clipper.cpp +++ b/dali-toolkit/internal/text/clipping/text-clipper.cpp @@ -78,11 +78,12 @@ void Clipper::Refresh( const Vector2& size ) FrameBufferImage frameBufferImage = FrameBufferImage::New( offscreenSize.width, offscreenSize.height, Pixel::RGBA8888 ); - mImageActor.SetSize( offscreenSize ); + mImageActor.SetPreferredSize( offscreenSize ); + mImageActor.SetResizePolicy( FIXED, ALL_DIMENSIONS ); mImageActor.SetImage( frameBufferImage ); mRenderTask.SetTargetFrameBuffer( frameBufferImage ); - // Stores current size to avoid create new Dali resources if text changes. + // Stores current sizPe to avoid create new Dali resources if text changes. mCurrentOffscreenSize = offscreenSize; } @@ -100,14 +101,16 @@ void Clipper::Initialize( const Vector2& size ) mOffscreenRootActor.SetPositionInheritanceMode( DONT_INHERIT_POSITION ); mOffscreenRootActor.SetInheritScale( false ); mOffscreenRootActor.SetDepthTestDisabled( true ); - mOffscreenRootActor.SetSize( offscreenSize ); + mOffscreenRootActor.SetResizePolicy( FIXED, ALL_DIMENSIONS ); + mOffscreenRootActor.SetPreferredSize( offscreenSize ); mImageActor = ImageActor::New(); mImageActor.SetParentOrigin( ParentOrigin::CENTER ); mImageActor.SetBlendFunc( BlendingFactor::ONE, BlendingFactor::ONE_MINUS_SRC_ALPHA, BlendingFactor::ONE, BlendingFactor::ONE ); mImageActor.SetScale( Vector3( 1.0f, -1.0f, 1.0f ) ); - mImageActor.SetSize( offscreenSize ); + mImageActor.SetPreferredSize( offscreenSize ); + mImageActor.SetResizePolicy( FIXED, ALL_DIMENSIONS ); // Creates a new camera actor. mOffscreenCameraActor = CameraActor::New(); diff --git a/dali-toolkit/internal/text/decorator/text-decorator.cpp b/dali-toolkit/internal/text/decorator/text-decorator.cpp index 88f22e5..551c961 100644 --- a/dali-toolkit/internal/text/decorator/text-decorator.cpp +++ b/dali-toolkit/internal/text/decorator/text-decorator.cpp @@ -182,13 +182,15 @@ struct Decorator::Impl : public ConnectionTracker { mPrimaryCursor.SetPosition( mCursor[PRIMARY_CURSOR].x + scrollPosition.x, mCursor[PRIMARY_CURSOR].y + scrollPosition.y ); - mPrimaryCursor.SetSize( 1.0f, mCursor[PRIMARY_CURSOR].height ); + mPrimaryCursor.SetResizePolicy( FIXED, ALL_DIMENSIONS ); + mPrimaryCursor.SetPreferredSize( Vector2( 1.0f, mCursor[PRIMARY_CURSOR].height ) ); } if( mSecondaryCursor ) { mSecondaryCursor.SetPosition( mCursor[SECONDARY_CURSOR].x + scrollPosition.x, mCursor[SECONDARY_CURSOR].y + scrollPosition.y ); - mSecondaryCursor.SetSize( 1.0f, mCursor[SECONDARY_CURSOR].height ); + mSecondaryCursor.SetResizePolicy( FIXED, ALL_DIMENSIONS ); + mSecondaryCursor.SetPreferredSize( Vector2( 1.0f, mCursor[SECONDARY_CURSOR].height ) ); } // Show or hide the grab handle @@ -339,7 +341,7 @@ struct Decorator::Impl : public ConnectionTracker mActiveLayer.SetAnchorPoint( AnchorPoint::CENTER); mActiveLayer.SetParentOrigin( ParentOrigin::CENTER); - //mActiveLayer.SetSizeMode( SIZE_EQUAL_TO_PARENT ); FIXME + mActiveLayer.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS ); mActiveLayer.SetPositionInheritanceMode( USE_PARENT_POSITION ); parent.Add( mActiveLayer ); @@ -364,19 +366,20 @@ struct Decorator::Impl : public ConnectionTracker mGrabHandle.SetParentOrigin( ParentOrigin::TOP_LEFT ); mGrabHandle.SetAnchorPoint( AnchorPoint::TOP_CENTER ); mGrabHandle.SetDrawMode( DrawMode::OVERLAY ); - // Area that Grab handle responds to, larger than actual handle so easier to move -#ifdef DECORATOR_DEBUG - mGrabArea = Toolkit::CreateSolidColorActor( Vector4(1.0f, 0.0f, 0.0f, 0.5f) ); - mGrabArea.SetName( "GrabArea" ); -#else - mGrabArea = Actor::New(); -#endif +//#ifdef DECORATOR_DEBUG +// mGrabArea = Toolkit::CreateSolidColorActor( Vector4(0.0f, 0.0f, 0.0f, 0.0f), true, Color::RED, 1 ); +// mGrabArea.SetName( "GrabArea" ); +//#else + mGrabArea = Actor::New(); //todo Force use of Actor until SolidColorActor fixed in Size Negotiation + mGrabArea.SetRelayoutEnabled( true ); +//#endif mGrabArea.SetParentOrigin( ParentOrigin::TOP_CENTER ); + mGrabArea.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS ); mGrabArea.SetAnchorPoint( AnchorPoint::TOP_CENTER ); mGrabArea.SetSizeMode( SIZE_RELATIVE_TO_PARENT ); mGrabArea.SetSizeModeFactor( DEFAULT_GRAB_HANDLE_RELATIVE_SIZE ); - mGrabHandle.Add(mGrabArea); + mGrabHandle.Add( mGrabArea ); mTapDetector.Attach( mGrabArea ); mPanGestureDetector.Attach( mGrabArea );