Skip to content

Commit

Permalink
HiDPI-related: Fix center to grab the correct color
Browse files Browse the repository at this point in the history
Not sure what was wrong with the old formula, but I think it had something to do with using the latest_pb instead of pb, which then broke on HiDPI screens again, making not the center center color the one picked but the top center one.
  • Loading branch information
moqmar committed Feb 7, 2017
1 parent f0f739c commit 260860c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pick/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,7 @@ def magnifier_clicked(self, window, ev):

def get_colour_from_pb(self, pb):
pixel_data = pb.get_pixels()
offset = (pb.get_rowstride() * (self.snapsize[1] / 2)) + ((self.latest_pb.get_rowstride() / self.snapsize[0]) * (self.snapsize[0] / 2))
offset = pb.get_rowstride() * pb.get_height() / 2 + (pb.get_rowstride() / 2)
rgb_vals = tuple([ord(x) for x in pixel_data[offset:offset+3]])
return rgb_vals

Expand Down

0 comments on commit 260860c

Please sign in to comment.