1
0
mirror of https://github.com/specht/champ.git synced 2024-12-22 03:30:47 +00:00

fixed 1D watches

This commit is contained in:
Michael Specht 2018-02-14 23:10:43 +01:00
parent 96ac1e69cf
commit e00f5e2fd4

View File

@ -273,7 +273,7 @@ class Champ
end end
normalized_item << x normalized_item << x
end end
offset = normalized_item.inject(0) { |x, y| (x << 8) + y } offset = normalized_item.reverse.inject(0) { |x, y| (x << 8) + y }
histogram[offset] ||= 0 histogram[offset] ||= 0
histogram[offset] += 1 histogram[offset] += 1
end end
@ -284,8 +284,8 @@ class Champ
pixels = [64] * width * height pixels = [64] * width * height
histogram.each_pair do |key, value| histogram.each_pair do |key, value|
y = key & 0xff; x = key & 0xff;
x = height - 1 - ((key >> 8) & 0xff) y = height - 1 - ((key >> 8) & 0xff)
ymin = y ymin = y
ymax = y ymax = y
if watch[:components].size == 1 if watch[:components].size == 1