Geography : bad color assignment when several life ways.
svn: r19463
This commit is contained in:
parent
3a1093edc4
commit
b1d7c68a89
@ -119,10 +119,10 @@ class LifeWayLayer(gobject.GObject, osmgpsmap.GpsMapLayer):
|
|||||||
ctx.set_line_join(cairo.LINE_JOIN_ROUND)
|
ctx.set_line_join(cairo.LINE_JOIN_ROUND)
|
||||||
ctx.set_line_width(3)
|
ctx.set_line_width(3)
|
||||||
color = gtk.gdk.color_parse(lifeway[1])
|
color = gtk.gdk.color_parse(lifeway[1])
|
||||||
ctx.set_source_rgba(color.red / 255,
|
ctx.set_source_rgba(float(color.red / 65535.0),
|
||||||
color.green / 255,
|
float(color.green / 65535.0),
|
||||||
color.blue / 255,
|
float(color.blue / 65535.0),
|
||||||
0.1) # transparency
|
0.1) # transparency
|
||||||
ggc = drawable.new_gc()
|
ggc = drawable.new_gc()
|
||||||
rds = float(lifeway[2])
|
rds = float(lifeway[2])
|
||||||
for point in lifeway[0]:
|
for point in lifeway[0]:
|
||||||
@ -163,9 +163,9 @@ class LifeWayLayer(gobject.GObject, osmgpsmap.GpsMapLayer):
|
|||||||
coord_x, coord_y = gpsmap.convert_geographic_to_screen(conv_pt)
|
coord_x, coord_y = gpsmap.convert_geographic_to_screen(conv_pt)
|
||||||
map_points.append((coord_x, coord_y))
|
map_points.append((coord_x, coord_y))
|
||||||
color = gtk.gdk.color_parse(lifeway[1])
|
color = gtk.gdk.color_parse(lifeway[1])
|
||||||
ctx.set_source_rgb(color.red / 255,
|
ctx.set_source_rgb(float(color.red / 65535.0),
|
||||||
color.green / 255,
|
float(color.green / 65535.0),
|
||||||
color.blue / 255)
|
float(color.blue / 65535.0))
|
||||||
first = True
|
first = True
|
||||||
for idx_pt in range(0, len(map_points)):
|
for idx_pt in range(0, len(map_points)):
|
||||||
if first:
|
if first:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user