Fixed vessel change code in native gui
This commit is contained in:
1 parent
09387280fc
commit
db74fb6970
16 files changed
+192
-33
No files matched your search
+6
-4
@@ -57,9 +57,11 @@ class StatusView:
|
||||
def vessel_modified(self, eventtype, data):
|
||||
print(f"Vessel changed. New ID={data[0]}")
|
||||
self.load_svg()
|
||||
#? self.area['status'].queue_draw()
|
||||
|
||||
def load_svg(self):
|
||||
if not self.context.vessel.shapefile:
|
||||
self.svg = None
|
||||
print("No Shapefile defined for current vessel")
|
||||
return
|
||||
shapefile = os.path.join(self.context.cfg['shapedir'], self.context.vessel.shapefile)
|
||||
@@ -111,13 +113,13 @@ class StatusView:
|
||||
print("No centerline with id='centerline' found!")
|
||||
|
||||
def on_drw_status_draw(self, area, cr):
|
||||
if self.context.vessel.pk_value is None:
|
||||
# no vessel defined
|
||||
return
|
||||
|
||||
cr.set_source_rgb(0.92, 0.97, 1.0)
|
||||
cr.paint()
|
||||
|
||||
if self.context.vessel.pk_value is None:
|
||||
# no vessel defined, empty area
|
||||
return False
|
||||
|
||||
if self.svg:
|
||||
allocation = area.get_allocation()
|
||||
scale_x = allocation.width / self.svg_width
|
||||
|
||||
Reference in new issue
Block a user