X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=plugins%2Fdali-script-v8%2Fsrc%2Factors%2Factor-api.cpp;h=9459a46b71e4ef04caca894e22a2e253768fab92;hb=a2de9cf491172cd5da9dc9ed60b17683dab6d7bc;hp=371639dd2a12a37885f3951ed0fa30b97b34e4b7;hpb=6e1c16f82d6ea3d44f74e4dc11212ac18c963ef4;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/plugins/dali-script-v8/src/actors/actor-api.cpp b/plugins/dali-script-v8/src/actors/actor-api.cpp index 371639d..9459a46 100644 --- a/plugins/dali-script-v8/src/actors/actor-api.cpp +++ b/plugins/dali-script-v8/src/actors/actor-api.cpp @@ -518,6 +518,31 @@ void ActorApi::GetNaturalSize( const v8::FunctionCallbackInfo& args ) } /** + * Return the value of negotiated dimension for the given dimension + * + * @for Actor + * @method getRelayoutSize + * @param {Integer} dimension The dimension of layout to retrieve (either dali.DIMENSION_WIDTH or dali.DIMENSION_HEIGHT) + * @return {Number} The value of the negotiated dimension + */ +void ActorApi::GetRelayoutSize( const v8::FunctionCallbackInfo& args ) +{ + v8::Isolate* isolate = args.GetIsolate(); + v8::HandleScope handleScope( isolate ); + Actor actor = GetActor( isolate, args ); + + bool found; + int dimension = V8Utils::GetIntegerParameter( PARAMETER_0, found, isolate, args, 0 ); + if( !found ) + { + DALI_SCRIPT_EXCEPTION( isolate, "missing dimension parameter"); + return; + } + + args.GetReturnValue().Set( v8::Number::New( isolate, actor.GetRelayoutSize( static_cast(dimension) ) ) ); +} + +/** * Calculate the width of the actor given a height * * The natural size is used for default calculation. @@ -696,7 +721,7 @@ void ActorApi::ScaleBy( const v8::FunctionCallbackInfo& args ) * Add a renderer to this actor. * @example * - * var renderer = new dali.Renderer( geometry, material ); + * var renderer = new dali.Renderer( geometry, shader ); * actor.addRenderer( renderer ); * * @for Actor