Quintiq file version 2.0
#parent: CustomDrawComponentContainer/CustomDrawDataLayerComponent
Response OnDetermineRegion (
  LibOpt_Component object
) id:Response_CustomDrawComponentContainer_CustomDrawDataLayerComponent_OnDetermineRegion
{
  #keys: '[139164.3.945951600]'
  Body:
  [*
    scale_x := ValueHolderScaleX.Data();
    scale_y := ValueHolderScaleY.Data();
    
    offset_x := ValueHolderOffsetX.Data();
    offset_y := ValueHolderOffsetY.Data();
    
    width := guard( object.UIGraphNode().Width() * scale_x, 0 );
    height := guard( object.UIGraphNode().Height() * scale_y, 0 );       
    
    x := guard( object.UIGraphNode().X() * scale_x, 0 ) - width  / 2 + offset_x;
    y := guard( object.UIGraphNode().Y() * scale_y, 0 ) - height / 2 + offset_y;
     
    rect := Rect::Construct( [Number] x,
                             [Number] y,
                             [Number] ( x + width  ) - [Number] x,
                             [Number] ( y + height ) - [Number] y );
    
    this.AddRegion( rect );
  *]
  CanBindMultiple: false
  DefinitionID: 'Responsedef_CustomDrawDataLayer_OnDetermineRegion'
}
