Skip to content

Commit b27527b

Browse files
author
Matthias Koefferlein
committed
Fixing issue #2331
1 parent 54dd7c5 commit b27527b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/laybasic/laybasic/layPixelBufferPainter.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ PixelBufferPainter::draw_text (const char *t, const db::Point &p, tl::Color c, i
163163
const uint32_t *dc = ff.data () + size_t (ch - ff.first_char ()) * ff.height () * ff.stride ();
164164
for (unsigned int i = 0; i < ff.height (); ++i, dc += ff.stride ()) {
165165

166-
int iy = y - ff.height () + i + 1;
167-
if (iy >= 0 || iy < int (mp_img->height ())) {
166+
int iy = y - ff.height () + i;
167+
if (iy >= 0 && iy < int (mp_img->height ())) {
168168

169-
uint32_t *d = (uint32_t *) mp_img->scan_line (y - ff.height () + i);
169+
uint32_t *d = (uint32_t *) mp_img->scan_line (iy);
170170
uint32_t m = 1;
171171
int ix = x;
172172
const uint32_t *ds = dc;

0 commit comments

Comments
 (0)