Skip to content

Commit

Permalink
Fix bug in ControlPlayer and ControlTimeline
Browse files Browse the repository at this point in the history
  • Loading branch information
UmSenhorQualquer committed Feb 26, 2019
1 parent 05ee238 commit 1ae2b7e
Show file tree
Hide file tree
Showing 10 changed files with 430 additions and 303 deletions.
12 changes: 6 additions & 6 deletions pyforms_gui/controls/control_event_timeline/TimelineChart.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,20 @@ def draw(self, painter, left, right, top, bottom):

if diff_max_min <= 0: diff_max_min = 1

last_coordenate = None
last_coordinate = None
last_real_x_coord = None

for i, y in enumerate(self._data[start:end]):
if y is not None:
x = i + start
if y == None: continue
y = self._top + ((top + y) * fov_height) // diff_max_min
if last_coordenate:
if last_coordinate:
diff_frames = abs(x - last_real_x_coord)
draw_from_coord = last_coordenate if diff_frames == 1 else (self._widget.frame2x(x), fov_height - y)
draw_from_coord = last_coordinate if diff_frames == 1 else (self._widget.frame2x(x), fov_height - y)
painter.drawLine(draw_from_coord[0], draw_from_coord[1], self._widget.frame2x(x), fov_height - y)

last_coordenate = self._widget.frame2x(x), fov_height - y
last_coordinate = self._widget.frame2x(x), fov_height - y
last_real_x_coord = x

painter.setOpacity(1.0)
Expand Down Expand Up @@ -172,9 +172,9 @@ def mouse_move_evt(self, event, top, bottom):

# no value
if self[frame] is None:
self._widget.graphs_properties.coordenate_text = None
self._widget.graphs_properties.coordinate_text = None
else:
self._widget.graphs_properties.coordenate_text = "Frame: {0} Value: {1}".format(frame, self[frame])
self._widget.graphs_properties.coordinate_text = "Frame: {0} Value: {1}".format(frame, self[frame])


def export_2_file(self, filename):
Expand Down

0 comments on commit 1ae2b7e

Please sign in to comment.