2 * GDI drawing functions.
4 * Copyright 1993, 1994 Alexandre Julliard
5 * Copyright 1997 Bertho A. Stultiens
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 * COPYRIGHT: See COPYING in the top level directory
24 * PROJECT: ReactOS GDI32
25 * PURPOSE: LineDDA Function
26 * FILE: win32ss/gdi/gdi32/objects/linedda.c
27 * PROGRAMER: Steven Edwards
28 * REVISION HISTORY: 2003/11/15 sedwards Created, 2009/04 gschneider Updated
29 * NOTES: Adapted from Wine
36 /**********************************************************************
40 BOOL WINAPI
LineDDA(INT nXStart
, INT nYStart
, INT nXEnd
, INT nYEnd
,
41 LINEDDAPROC callback
, LPARAM lParam
)
43 INT xadd
= 1, yadd
= 1;
46 INT dx
= nXEnd
- nXStart
;
47 INT dy
= nYEnd
- nYStart
;
59 if (dx
> dy
) /* line is "more horizontal" */
63 for(cnt
= 0; cnt
< dx
; cnt
++)
65 callback(nXStart
,nYStart
,lParam
);
75 else /* line is "more vertical" */
79 for(cnt
= 0; cnt
< dy
; cnt
++)
81 callback(nXStart
,nYStart
,lParam
);