Changeset 9737 for trunk/src


Ignore:
Timestamp:
Jan 28, 2003, 5:21:49 PM (23 years ago)
Author:
sandervl
Message:

Fixes for InternalTextOutA without y-inversion (not activated)

Location:
trunk/src/gdi32
Files:
2 edited

Legend:

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

    r9443 r9737  
    1 /* $Id: oslibgpi.cpp,v 1.12 2002-11-29 13:46:04 sandervl Exp $ */
     1/* $Id: oslibgpi.cpp,v 1.13 2003-01-28 16:21:48 sandervl Exp $ */
    22
    33/*
     
    407407  rc = GpiQueryFontMetrics(hdc, sizeof(metrics), &metrics);
    408408  if(rc) {
    409         return metrics.lMaxAscender;
     409        return max(metrics.lMaxBaselineExt,
     410                   max(metrics.lMaxAscender+metrics.lMaxDescender,
     411                       metrics.lInternalLeading+metrics.lEmHeight));
    410412  }
    411413  else {
  • trunk/src/gdi32/text.cpp

    r9609 r9737  
    1 /* $Id: text.cpp,v 1.31 2003-01-04 13:45:10 sandervl Exp $ */
     1/* $Id: text.cpp,v 1.32 2003-01-28 16:21:49 sandervl Exp $ */
    22
    33/*
     
    7373//******************************************************************************
    7474// todo: metafile support
     75//#undef INVERT
     76//#define INVERT_SETYINVERSION
    7577//******************************************************************************
    7678BOOL InternalTextOutA(HDC hdc,int X,int Y,UINT fuOptions,CONST RECT *lprc,LPCSTR lpszString,INT cbCount,CONST INT *lpDx,BOOL IsExtTextOut)
     
    101103        return TRUE;
    102104  }
     105
     106#if defined(INVERT) && !defined(INVERT_SETYINVERSION)
     107  if(pHps->yInvert > 0) {
     108     Y = pHps->yInvert - Y;
     109  }
     110#endif
     111
     112#ifdef INVERT_SETYINVERSION
     113  int oldyinv = GpiQueryYInversion(pHps->hps);
     114  Y = oldyinv - Y;
     115#endif
    103116
    104117  //CB: add metafile info
     
    115128      }
    116129#ifndef INVERT
     130#ifdef INVERT_SETYINVERSION
     131      if (oldyinv) {
     132          int temp       = oldyinv - pmRect.yTop;
     133          pmRect.yTop    = oldyinv - pmRect.yBottom;
     134          pmRect.yBottom = temp;
     135      }
     136#else
    117137      if (pHps->yInvert > 0) {
    118138          int temp       = pHps->yInvert - pmRect.yTop;
     
    120140          pmRect.yBottom = temp;
    121141      }   
     142#endif
    122143#endif
    123144
     
    162183    }
    163184  }
     185
     186#ifdef INVERT_SETYINVERSION
     187  GpiEnableYInversion(pHps->hps, 0);
     188#endif
     189
    164190  if (lpDx)
    165191    flOptions |= CHSOS_VECTOR;
     
    169195    ptl.x = X;
    170196    ptl.y = Y;
    171 
    172 #ifndef INVERT
    173     if (pHps->yInvert > 0) {
    174        ptl.y = pHps->yInvert - Y;
    175     }
    176 #endif
    177197
    178198    flOptions |= CHSOS_LEAVEPOS;
     
    210230  }
    211231
     232#ifdef INVERT
    212233  ptl.y += getWorldYDeltaFor1Pixel(pHps);
    213 
    214 #ifndef INVERT
     234#else
     235  ptl.y -= getWorldYDeltaFor1Pixel(pHps);
     236
    215237  int vertAdjust = 0;
    216   if ((pHps->taMode & 0x18) == TA_TOP)
     238  if ((pHps->taMode & 0x18) != TA_TOP)
    217239  {
    218240      vertAdjust = OSLibGpiQueryFontMaxHeight(pHps->hps);
     
    228250  if(hits == GPIOS_ERROR) {
    229251        dprintf(("InternalTextOutA: OSLibGpiCharStringPosAt returned GPIOS_ERROR"));
     252#ifdef INVERT_SETYINVERSION
     253        GpiEnableYInversion(pHps->hps, oldyinv);
     254#endif
    230255        return FALSE;
    231256  }
     
    241266  }
    242267
     268#ifdef INVERT_SETYINVERSION
     269  GpiEnableYInversion(pHps->hps, oldyinv);
     270#endif
    243271  return TRUE;
    244272}
Note: See TracChangeset for help on using the changeset viewer.