Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2003:
[Freeciv-Dev] (PR#1180) canvas_to_map_pos() off by one
Home

[Freeciv-Dev] (PR#1180) canvas_to_map_pos() off by one

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#1180) canvas_to_map_pos() off by one
From: "a-l@xxxxxxx" <a-l@xxxxxxx>
Date: Wed, 26 Mar 2003 06:48:45 -0800
Reply-to: rt@xxxxxxxxxxxxxx

1 year+ old issue.

In isometric mode, this operation still decreases tile_x by 1:

{
  map_to_canvas_pos(&canvas_x, &canvas_y, tile_x, tile_y);
  canvas_to_map_pos(&tile_x, &tile_y, canvas_x, canvas_y);
}

I work around the problem like this:

{
  map_to_canvas_pos(&canvas_x, &canvas_y, tile_x, tile_y);
  canvas_x += NORMAL_TILE_WIDTH / 2;
  canvas_to_map_pos(&tile_x, &tile_y, canvas_x, canvas_y);
}


Arnstein



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