Skip to content

Commit a857116

Browse files
committed
Fix #102 Musicscore gets blank when clicking on the music panel background
1 parent 2cfa74d commit a857116

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

music_score_panel.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,9 @@ def draw_drag_rect(self, dc):
257257
#z = self.renderer.zoom
258258
#dc.Scale(z, z)
259259
x, y, width, height = self.drag_rect
260-
dc.SetPen( dc.CreatePen(wx.Pen(wx_colour('black'), 1.0, style=wx.DOT )) )
260+
#FAU Width argument for pen is an int not a float.
261+
#dc.SetPen( dc.CreatePen(wx.Pen(wx_colour('black'), 1.0, style=wx.DOT )) )
262+
dc.SetPen( dc.CreatePen(wx.Pen(wx_colour('black'), width=1, style=wx.DOT )) )
261263
dc.SetBrush(dc.CreateBrush(wx.Brush(wx_colour('#fffbc6'), wx.SOLID)))
262264
path = dc.CreatePath()
263265
path.MoveToPoint(x, y)

svgrenderer.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,9 @@ def calc_dist_key(k):
265265

266266
def select_notes(self, selection_rect):
267267
in_selection = selection_rect.Contains
268-
selected_offsets = set((abc_row, abc_col) for (x, y, abc_row, abc_col, desc) in self.notes if in_selection((x, y)))
268+
#FAU wx.Rect Contains needs integer as coordinates
269+
#selected_offsets = set((abc_row, abc_col) for (x, y, abc_row, abc_col, desc) in self.notes if in_selection((x, y)))
270+
selected_offsets = set((abc_row, abc_col) for (x, y, abc_row, abc_col, desc) in self.notes if in_selection((int(x), int(y))))
269271
list_of_sets = [self.indices_per_row_col[row][col] for row, col in selected_offsets]
270272
selected_indices = set().union(*list_of_sets)
271273
if selected_indices:

0 commit comments

Comments
 (0)