Ignore:
Timestamp:
Apr 10, 2012, 9:55:43 PM (13 years ago)
Author:
dmik
Message:

gdi32: Fix lost text in TextOut when used with non-identity trasformation matrix.

This was a regression of r21628 wchich I completely reverted. See #81 for details.

File:
1 edited

Legend:

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

    r21628 r21997  
    9595//******************************************************************************
    9696// todo: metafile support
     97//#undef INVERT
     98//#define INVERT_SETYINVERSION
    9799//******************************************************************************
    98100BOOL InternalTextOutAW(HDC hdc,int X,int Y,UINT fuOptions,
     
    133135  }
    134136
     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
    135148  // When using font association, the height of DBCS and SBCS chars may be different.
    136149  // In this case, background color make stair below chars
     
    168181        return TRUE;
    169182      }
     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
    170198
    171199      if (fuOptions & ETO_CLIPPED) flOptions |= CHSOS_CLIP;
     
    216244    }
    217245  }
     246
     247#ifdef INVERT_SETYINVERSION
     248  GpiEnableYInversion(pHps->hps, 0);
     249#endif
    218250
    219251  if (lpDx)
     
    309341  if(hits == GPIOS_ERROR) {
    310342      dprintf(("InternalTextOutA: OSLibGpiCharStringPosAt returned GPIOS_ERROR"));
     343#ifdef INVERT_SETYINVERSION
     344      GpiEnableYInversion(pHps->hps, oldyinv);
     345#endif
    311346      return FALSE;
    312347  }
     
    321356      OSLibGpiSetCurrentPosition(pHps,&ptl);
    322357  }
     358
     359#ifdef INVERT_SETYINVERSION
     360  GpiEnableYInversion(pHps->hps, oldyinv);
     361#endif
    323362
    324363  DIBSECTION_MARK_INVALID(hdc);
Note: See TracChangeset for help on using the changeset viewer.