From 260860c687a335582c3eb9a22b8b06ba7b2f3c2f Mon Sep 17 00:00:00 2001 From: Moritz Marquardt Date: Tue, 7 Feb 2017 13:00:36 +0100 Subject: [PATCH] HiDPI-related: Fix center to grab the correct color 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. --- pick/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pick/__main__.py b/pick/__main__.py index 9f2d535..6778f87 100644 --- a/pick/__main__.py +++ b/pick/__main__.py @@ -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