mirror of
https://github.com/robmcmullen/atrcopy.git
synced 2024-06-09 00:29:28 +00:00
Fixed rectangle style setting if segment has an incomplete last line
This commit is contained in:
parent
510366051c
commit
32d3e0de76
|
@ -753,7 +753,12 @@ class DefaultSegment(object):
|
||||||
r = r2 - r1
|
r = r2 - r1
|
||||||
c = c2 - c1
|
c = c2 - c1
|
||||||
indexes = np.tile(np.arange(c), r) + np.repeat(np.arange(r) * bytes_per_row, c) + start
|
indexes = np.tile(np.arange(c), r) + np.repeat(np.arange(r) * bytes_per_row, c) + start
|
||||||
s[indexes] |= style_bits
|
|
||||||
|
# Limit the indexes actually used to the size of the array, because
|
||||||
|
# if the region has an incomplete last line, the style setting
|
||||||
|
# would fail because it isn't be a perfect rectangle
|
||||||
|
clamped = indexes[np.where(np.less(indexes, len(self)))[0]]
|
||||||
|
s[clamped] |= style_bits
|
||||||
|
|
||||||
def rects_to_ranges(self, rects, bytes_per_row):
|
def rects_to_ranges(self, rects, bytes_per_row):
|
||||||
ranges = []
|
ranges = []
|
||||||
|
|
Loading…
Reference in New Issue
Block a user