Ignore:
Timestamp:
Jul 16, 2003, 5:47:37 PM (22 years ago)
Author:
sandervl
Message:

KOM: Fixed GetTextFaceW() to support unicode correctly; Fixed calcDimensions

File:
1 edited

Legend:

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

    r9737 r10174  
    1 /* $Id: oslibgpi.cpp,v 1.13 2003-01-28 16:21:48 sandervl Exp $ */
     1/* $Id: oslibgpi.cpp,v 1.14 2003-07-16 15:47:37 sandervl Exp $ */
    22
    33/*
     
    259259  if (box[TXTBOX_BOTTOMLEFT].y == box[TXTBOX_BOTTOMRIGHT].y)
    260260  {
    261     point->y = labs (box[TXTBOX_BOTTOMLEFT].y-box[TXTBOX_TOPLEFT].y);
    262     point->x = labs (box[TXTBOX_BOTTOMRIGHT].x-box[TXTBOX_BOTTOMLEFT].x);
    263 
     261    point->y = labs (box[TXTBOX_BOTTOMLEFT].y-box[TXTBOX_TOPLEFT].y) + 1;
     262    point->x = labs (box[TXTBOX_BOTTOMRIGHT].x-box[TXTBOX_BOTTOMLEFT].x) + 1;
    264263    if (box[TXTBOX_BOTTOMLEFT].x != box[TXTBOX_TOPLEFT].x)
    265264    {
     
    272271  } else
    273272  {
    274     cx = labs (box[TXTBOX_BOTTOMLEFT].x-box[TXTBOX_TOPLEFT].x);
    275     cy = labs (box[TXTBOX_BOTTOMLEFT].y-box[TXTBOX_TOPLEFT].y);
     273    cx = labs (box[TXTBOX_BOTTOMLEFT].x-box[TXTBOX_TOPLEFT].x) + 1;
     274    cy = labs (box[TXTBOX_BOTTOMLEFT].y-box[TXTBOX_TOPLEFT].y) + 1;
    276275    point->y = (ULONG)hypot(cx,cy);
    277276
    278     cx = labs (box[TXTBOX_TOPRIGHT].x-box[TXTBOX_TOPLEFT].x);
    279     cy = labs (box[TXTBOX_TOPRIGHT].y-box[TXTBOX_TOPLEFT].y);
     277    cx = labs (box[TXTBOX_TOPRIGHT].x-box[TXTBOX_TOPLEFT].x) + 1;
     278    cy = labs (box[TXTBOX_TOPRIGHT].y-box[TXTBOX_TOPLEFT].y) + 1;
    280279    point->x  = (ULONG)hypot(cx,cy);
    281280  }
     
    400399
    401400
    402 int OSLibGpiQueryFontMaxHeight(HDC hdc) 
     401int OSLibGpiQueryFontMaxHeight(HDC hdc)
    403402{
    404403  FONTMETRICS metrics;
     
    407406  rc = GpiQueryFontMetrics(hdc, sizeof(metrics), &metrics);
    408407  if(rc) {
    409         return max(metrics.lMaxBaselineExt,
    410                    max(metrics.lMaxAscender+metrics.lMaxDescender, 
     408    return max(metrics.lMaxBaselineExt,
     409                   max(metrics.lMaxAscender+metrics.lMaxDescender,
    411410                       metrics.lInternalLeading+metrics.lEmHeight));
    412411  }
    413412  else {
    414         dprintf(("GpiQueryFontMetrics returned FALSE!!"));
    415         return 0;
     413    dprintf(("GpiQueryFontMetrics returned FALSE!!"));
     414    return 0;
    416415  }
    417416}
     
    425424    if(!pHps)
    426425    {
    427         return;
     426    return;
    428427    }
    429428
Note: See TracChangeset for help on using the changeset viewer.