Changeset 2615


Ignore:
Timestamp:
04/12/07 14:39:34 (13 years ago)
Author:
sorber
Message:

Set getData to return null for zero-length arrows.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/visbio/overlays/OverlayArrow.java

    r2534 r2615  
    5454  /** Gets VisAD data object representing this overlay. */ 
    5555  public DataImpl getData() { 
     56    if (x1 == x2 && y1 == y2) return null; // dont render zero length arrows 
    5657    float padding = 0.02f * overlay.getScalingValue(); 
    5758    double xx = x2 - x1; 
     
    6970    }; 
    7071 
    71     boolean missing = false; 
    72     for (int i=0; i<setSamples.length; i++) { 
    73       for (int j=0; j<setSamples[i].length; j++) { 
    74         if (Float.isNaN(setSamples[i][j])) missing = true; 
    75       } 
    76     } 
    77  
    7872    GriddedSet fieldSet = null; 
    7973    try { 
    80       if (filled && !missing) { 
     74      if (filled) { 
    8175        fieldSet = new Gridded2DSet(domain, 
    8276          setSamples, 2, 2, null, null, null, false, false); 
     
    122116  /** Gets a selection grid for this object */ 
    123117  public DataImpl getSelectionGrid(boolean outline) { 
    124     if (outline) return super.getSelectionGrid(true); 
     118    if (x1 == x2 && y1 == y2) return null; // dont render zero length arrows 
     119    else if (outline) return super.getSelectionGrid(true); 
    125120 
    126121    RealTupleType domain = overlay.getDomainType(); 
Note: See TracChangeset for help on using the changeset viewer.