Author: esr
Date: Tue Oct 21 01:50:50 2008
New Revision: 30290
URL: http://svn.gna.org/viewcvs/wesnoth?rev=30290&view=rev
Log:
trackplacer: fix bugs in feature-overlap detection.
Modified:
trunk/data/tools/trackplacer
Modified: trunk/data/tools/trackplacer
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/trackplacer?rev=30290&r1=30289&r2=30290&view=diff
==============================================================================
--- trunk/data/tools/trackplacer (original)
+++ trunk/data/tools/trackplacer Tue Oct 21 01:50:50 2008
@@ -122,10 +122,16 @@
return True
return False
-def overlaps((x, y, xd, yd), rect):
+def overlaps((x1,y1,x1d,y1d),(x2,y2,x2d,y2d)):
"Do two rectangles overlap?"
- return within(x, y, rect) or within(x+xd-1, y, rect) or \
- within(x, y+yd-1, rect) or within(x+xd-1, y+yd+1, rect)
+ return within(x1, y1, (x2, y2, x2, y2d)) or \
+ within(x1+x1d-1, y1, (x2, y2, x2, y2d)) or \
+ within(x1, y1+y1d-1, (x2, y2, x2, y2d)) or \
+ within(x1+x1d-1, y1+y1d+1, (x2, y2, x2, y2d)) or \
+ within(x2, y2, (x1, y1, x1, y1d)) or \
+ within(x2+x2d-2, y2, (x1, y1, x1, y1d)) or \
+ within(x2, y2+y2d-2, (x1, y1, x1, y1d)) or \
+ within(x2+x2d-2, y2+y2d+2, (x1, y1, x1, y1d))
class JourneyTracks:
"Represent a set of named journey tracks on a map."
@@ -348,7 +354,7 @@
if within(x, y, self.editor.box(item)):
stagecount = 0
for i in range(possible):
- (action, x, y) = self.editor.journey[i]
+ (action, xn, yn) = self.editor.journey[i]
if action in segmenters:
stagecount += 1
local.append((name, possible,
self.editor.journey[possible], stagecount))
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits