Re: #9674: wxDC::DrawPoint draw two point, one in ( x, y ) and second in ( x+1, y+1 )

17 views
Skip to first unread message

wxTrac

unread,
Mar 6, 2012, 5:49:53 PM3/6/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/9674#comment:1>

#9674: wxDC::DrawPoint draw two point, one in ( x, y ) and second in ( x+1, y+1 )
--------------------------+-------------------------------------------------
Reporter: lester | Owner:
Type: defect | Status: confirmed
Priority: normal | Milestone:
Component: wxOSX-Carbon | Version: 2.8.12
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------
Changes (by etxmato):

* cc: marcel.v.tongeren@… (added)
* status: new => confirmed
* version: 2.8.7 => 2.8.12


Comment:

I have exactly the same issue in version 2.8.12 running on OS X Lion.

The workaround with DrawLine (x, y, x, y) works indeed fine but I would
prefer a fix for the DrawPoint.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/9674#comment:1>

wxTrac

unread,
Jan 28, 2017, 9:10:08 PM1/28/17
to wx-...@googlegroups.com
#9674: wxDC::DrawPoint draw two point, one in ( x, y ) and second in ( x+1, y+1 )
---------------------+------------------------
Reporter: lester | Owner:
Type: defect | Status: confirmed
Priority: normal | Milestone:
Component: wxGTK | Version: dev-latest
Resolution: | Keywords:
Blocked By: | Blocking:
Patch: 0 |
---------------------+------------------------
Changes (by david_costanzo):

* version: 2.8.12 => dev-latest
* component: old wxOSX/Carbon port => wxGTK


Comment:

I ran into the same problem when porting FMSLogo from win32 to wxWidgets.

The bug exists on GTK3 using wxWidgets-3.0.2 (version on Fedora Core 25)
and using a recent update from github (see drawpoint-gtk3.png)

The bug does NOT exist on MSW (see drawpoint-msw.png).

This may be a duplicate of bug #4550

I have updated the fields to indicate that the problem affects recent
versions of wxWidgets.

--
Ticket URL: <http://trac.wxwidgets.org/ticket/9674#comment:2>

wxTrac

unread,
Jan 28, 2017, 10:31:29 PM1/28/17
to wx-...@googlegroups.com
#9674: wxDC::DrawPoint draw two point, one in ( x, y ) and second in ( x+1, y+1 )
---------------------+------------------------
Reporter: lester | Owner:
Type: defect | Status: confirmed
Priority: normal | Milestone:
Component: wxGTK | Version: dev-latest
Resolution: | Keywords:
Blocked By: | Blocking:
Patch: 0 |
---------------------+------------------------

Comment (by david_costanzo):

I tried to see how this could be fixed, but the problem goes deeper than
just DrawPoint. The reason for the two pixels is clear in
src/common/dcgraph.cpp

{{{
void wxGCDCImpl::DoDrawPoint( wxCoord x, wxCoord y )
{
wxCHECK_RET( IsOk(), wxT("wxGCDC(cg)::DoDrawPoint - invalid DC") );

DoDrawLine( x , y , x + 1 , y + 1 );
}
}}}

In other words `wxDC::DrawPoint()` //intentionally// draws a short line.
It would be easy enough to change this to `DoDrawLine(x,y,x,y)`, but I
think the parameters are correct and the root of this bug is that
DoDrawLine() is drawing the second endpoint.

DoDrawLine is the same helper function that's used by `wxDC::DrawPoint`,
whose
[http://docs.wxwidgets.org/trunk/classwx_d_c.html#a12f2c236d4d320acec0bc6fe20e8399d
documentation] states

> Note that the point (x2, y2) is not part of the line and is not drawn by
this function (this is consistent with the behaviour of many other
toolkits).

However, on GTK3, `wxDC::DrawPoint(x1,y1,x2,y2)` //does// draw the point
at (x2, y2). I didn't see a way to tell Cairo (the line drawing library
used) not to draw the endpoint and it might be that the raster legacy of
wxWidgets is incompatible with a vector graphics library.

--
Ticket URL: <http://trac.wxwidgets.org/ticket/9674#comment:3>
Reply all
Reply to author
Forward
0 new messages