Quintiq file version 2.0
#parent: CustomDrawSCO/CustomDrawDataLayerStockingPointUnitEdge
Response OnDrawObject (
  StockingPointUnitEdge object
) id:Response_CustomDrawSCO_CustomDrawDataLayerStockingPointUnitEdge_OnDrawObject
{
  #keys: '[136682.0.1903689550]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebCustomDrawDataLayer_OnDrawObject'
  GroupServerCalls: true
  QuillAction
  {
    Body:
    [*
      // Draw SPUE
      
      // draw line
      minx := minvalue ( object.FromX(), object.ToX() );
      miny := minvalue ( object.FromY(), object.ToY() );
      
      // region always starts at 0,0
      adjustX := 0 - minx;
      adjustY := 0 - miny;
      
      color := ColorScheme.SupplyChainOverview_StockingPointUnit();
      if ( object.SupplyChainView().ArrowColor() <> '' )
      {
        color := guard( Color::Color( object.SupplyChainView().ArrowColor() ), ColorScheme.SupplyChainOverview_StockingPointUnit() );
      }
      
      surface.Pen().Color( color ); 
      surface.Pen().Style( PenSpecification::StyleDashed() );
      surface.Pen().Width( 1 );
      surface.Brush().Color( color ); // to paint the solid arrowhead
      
      line := GraphicalLine::LineTo( object.FromX() + adjustX, object.FromY() + adjustY, object.ToX() + adjustX, object.ToY() + adjustY );
      line.ArrowToEnd( true ).ArrowPos( GraphicalLine::ArrowPosMiddle() );
      
      surface.Draw( line );
    *]
  }
}
