Ignore:
Timestamp:
Apr 21, 2011, 10:41:04 PM (14 years ago)
Author:
dmik
Message:

gdi32: Fixed broken TextOut API family that would draw text flipped along the base line.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gdi32/text.cpp

    r10600 r21628  
    9595//******************************************************************************
    9696// todo: metafile support
    97 //#undef INVERT
    98 //#define INVERT_SETYINVERSION
    9997//******************************************************************************
    10098BOOL InternalTextOutAW(HDC hdc,int X,int Y,UINT fuOptions,
     
    135133  }
    136134
    137 #if defined(INVERT) && !defined(INVERT_SETYINVERSION)
    138   if(pHps->yInvert > 0) {
    139      Y = pHps->yInvert - Y;
    140   }
    141 #endif
    142 
    143 #ifdef INVERT_SETYINVERSION
    144   int oldyinv = GpiQueryYInversion(pHps->hps);
    145   Y = oldyinv - Y;
    146 #endif
    147 
    148135  // When using font association, the height of DBCS and SBCS chars may be different.
    149136  // In this case, background color make stair below chars
     
    181168        return TRUE;
    182169      }
    183 #ifndef INVERT
    184 #ifdef INVERT_SETYINVERSION
    185       if (oldyinv) {
    186           int temp       = oldyinv - pmRect.yTop;
    187           pmRect.yTop    = oldyinv - pmRect.yBottom;
    188           pmRect.yBottom = temp;
    189       }
    190 #else
    191       if (pHps->yInvert > 0) {
    192           int temp       = pHps->yInvert - pmRect.yTop;
    193           pmRect.yTop    = pHps->yInvert - pmRect.yBottom;
    194           pmRect.yBottom = temp;
    195       }
    196 #endif
    197 #endif
    198170
    199171      if (fuOptions & ETO_CLIPPED) flOptions |= CHSOS_CLIP;
     
    244216    }
    245217  }
    246 
    247 #ifdef INVERT_SETYINVERSION
    248   GpiEnableYInversion(pHps->hps, 0);
    249 #endif
    250218
    251219  if (lpDx)
     
    341309  if(hits == GPIOS_ERROR) {
    342310      dprintf(("InternalTextOutA: OSLibGpiCharStringPosAt returned GPIOS_ERROR"));
    343 #ifdef INVERT_SETYINVERSION
    344       GpiEnableYInversion(pHps->hps, oldyinv);
    345 #endif
    346311      return FALSE;
    347312  }
     
    356321      OSLibGpiSetCurrentPosition(pHps,&ptl);
    357322  }
    358 
    359 #ifdef INVERT_SETYINVERSION
    360   GpiEnableYInversion(pHps->hps, oldyinv);
    361 #endif
    362323
    363324  DIBSECTION_MARK_INVALID(hdc);
Note: See TracChangeset for help on using the changeset viewer.