Ignore:
Timestamp:
Nov 4, 2000, 5:29:24 PM (25 years ago)
Author:
sandervl
Message:

OffsetRgn fix + small changes

File:
1 edited

Legend:

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

    r2802 r4552  
    1 /* $Id: line.cpp,v 1.6 2000-02-16 14:18:10 sandervl Exp $ */
     1/* $Id: line.cpp,v 1.7 2000-11-04 16:29:24 sandervl Exp $ */
    22/*
    33 * Line API's
     
    1414#include "callback.h"
    1515#include "oslibgpi.h"
     16#include <dcdata.h>
    1617
    1718#define DBG_LOCALLOG    DBG_line
     
    4849}
    4950
    50 BOOL drawSingleLinePoint(HDC hdc,PVOID pHps,PPOINTLOS2 pt)
     51BOOL drawSingleLinePoint(HDC hdc,pDCData pHps,PPOINTLOS2 pt)
    5152{
    5253  LOGPEN penInfo;
     
    7273BOOL WIN32API MoveToEx( HDC hdc, int X, int Y, LPPOINT lpPoint)
    7374{
    74   PVOID pHps = OSLibGpiQueryDCData(hdc);
     75  pDCData pHps = (pDCData)OSLibGpiQueryDCData(hdc);
    7576
    7677  dprintf(("GDI32: MoveToEx %x (%d,%d)", hdc, X, Y));
     
    7980  {
    8081    POINTLOS2 newPoint = {X,Y};
     82
     83#ifndef INVERT
     84    if(pHps->yInvert > 0) {
     85         newPoint.y =  pHps->yInvert - newPoint.y;
     86         if (lpPoint) {
     87            lpPoint->y = pHps->yInvert - lpPoint->y;
     88         }
     89    }
     90#endif
    8191
    8292    if (lpPoint)
     
    105115BOOL WIN32API LineTo( HDC hdc, int nXEnd, int  nYEnd)
    106116{
    107   PVOID pHps = OSLibGpiQueryDCData(hdc);
     117  pDCData pHps = (pDCData)OSLibGpiQueryDCData(hdc);
    108118  BOOL rc = TRUE;
    109119
     
    114124    POINTLOS2 oldPoint,newPoint;
    115125    BOOL bWideLine;
     126
     127#ifndef INVERT
     128    if (pHps->yInvert > 0) {
     129       nYEnd = pHps->yInvert - nYEnd;
     130    }
     131#endif
    116132
    117133    //CB: add metafile info
     
    151167{
    152168  BOOL                 rc;
     169#ifndef STDCALL_ENUMPROCS
    153170  LineDDAProcCallback *callback = new LineDDAProcCallback(lpLineFunc, lpData);
     171#endif
    154172  POINTLOS2 startPt,endPt;
    155173
     
    160178  toWin32LineEnd(&startPt,nXEnd,nYEnd,&endPt);
    161179
    162   rc = O32_LineDDA(startPt.x,startPt.y,endPt.x,endPt.y,callback->GetOS2Callback(),(LPARAM)callback);
     180  rc = O32_LineDDA(startPt.x,startPt.y,endPt.x,endPt.y, lpLineFunc, lpData);
     181#else
     182#ifdef STDCALL_ENUMPROCS
     183  //should change os2win.h
     184  rc = O32_LineDDA(nXStart,nYStart,nXEnd,nYEnd, (LINEDDAPROC_O32)lpLineFunc, lpData);
    163185#else
    164186  rc = O32_LineDDA(nXStart,nYStart,nXEnd,nYEnd,callback->GetOS2Callback(),(LPARAM)callback);
    165 #endif
    166187  if(callback)
    167188        delete callback;
     189#endif
     190
     191#endif
    168192  return(rc);
    169193}
     
    172196BOOL WIN32API Polyline( HDC hdc, const POINT *lppt, int cPoints)
    173197{
    174   PVOID pHps = OSLibGpiQueryDCData(hdc);
     198  pDCData pHps = (pDCData)OSLibGpiQueryDCData(hdc);
    175199
    176200  dprintf(("GDI32: Polyline"));
     
    186210  {
    187211    SetLastError(ERROR_INVALID_PARAMETER);
    188 
    189212    return FALSE;
    190213  }
     
    193216  {
    194217    drawSingleLinePoint(hdc,pHps,(PPOINTLOS2)lppt); //CB: check metafile recording
    195 
    196218    return TRUE;
    197219  }
     
    211233BOOL WIN32API PolylineTo( HDC hdc, const POINT * lppt, DWORD cCount)
    212234{
    213   PVOID pHps = OSLibGpiQueryDCData(hdc);
     235  pDCData pHps = (pDCData)OSLibGpiQueryDCData(hdc);
    214236
    215237  dprintf(("GDI32: PolylineTo"));
     
    228250  {
    229251    drawSingleLinePoint(hdc,pHps,(PPOINTLOS2)lppt);
    230 
    231252    return TRUE;
    232253  }
Note: See TracChangeset for help on using the changeset viewer.