Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2004:
[Freeciv-Dev] Re: (PR#7446) center_on_something fails
Home

[Freeciv-Dev] Re: (PR#7446) center_on_something fails

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx, per@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#7446) center_on_something fails
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Tue, 13 Apr 2004 09:33:20 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7446 >

On Tue, Apr 13, 2004 at 09:00:45AM -0700, Jason Short wrote:
> 
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=7446 >
> 
> Raimar Falke wrote:
> 
> >>What it comes down to is that the canvas needs to be configured before 
> >>it is used.  This configuring comes when the GUI calls 
> >>map_canvas_resized.  There is no need to do a pre-configuring for these 
> >>values.  The ones we're setting to zero are already zero (except for the 
> >>bug), and the mapcanvas that gets a dummy value shouldn't ever have this 
> >>value used (that would also be a bug).
> > 
> > 
> > These two
> >   mapview_canvas.store = canvas_create(1, 1);
> >   mapview_canvas.single_tile
> >     = canvas_create(UNIT_TILE_WIDTH, UNIT_TILE_HEIGHT);
> > aren't set to zero. Are these the bugs you speak about?
> > 
> > At least the single_tile assignment isn't IMHO.
> 
> The single_tile assignment is the only one that is needed.  The 
> existance of any of the other lines in this function will introduce a 
> bug in the gtk2 client, 

> since this client will have already called map_canvas_resized by the
> time this function is called.

I agree.

> Note that we could easily remove the function entirely, and put the 
> creation of single_tile into map_canvas_resized.

Hmmm. Not very clean.

> I don't think it's important to explicitly zero values that are already 
> zero, especially when we're about to set them to non-zero values a few 
> milliseconds later.  

> And it's also not important to create a dummy mapview store, since
> if this store were ever used that would be a bug.

I agree.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  reality.sys corrupt. Reboot Universe? (y,n,q)




[Prev in Thread] Current Thread [Next in Thread]