IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10729


Ignore:
Timestamp:
Dec 14, 2006, 9:11:17 AM (19 years ago)
Author:
magnier
Message:

fixed inconsistency with string in vs out

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/psRegion.c

    r9538 r10729  
    8181psString psRegionToString(const psRegion region)
    8282{
    83     char tmpText[256]; // big enough to store any region as text
     83    char *result = NULL;
    8484
    85     snprintf(tmpText,256,"[%g:%g,%g:%g]",
    86              region.x0+1, region.x1,
    87              region.y0+1, region.y1);
    88 
    89     return psStringCopy(tmpText);
     85    // [0:0,0:0] is complete image region
     86    if ((region.x0 == 0) && (region.x1 == 0) && (region.y0 == 0) && (region.y1 == 0)) {
     87        psStringAppend(&result, "[0:0,0:0]");
     88    } else {
     89        psStringAppend(&result, "[%g:%g,%g:%g]",
     90                       region.x0+1, region.x1,
     91                       region.y0+1, region.y1);
     92    }
     93    return result;
    9094}
    91 
    9295
    9396// define a square region centered on the given coordinate
Note: See TracChangeset for help on using the changeset viewer.