author | mouse <mouse> | 2004-03-31 14:54:16 (UTC) |
---|---|---|
committer | mouse <mouse> | 2004-03-31 14:54:16 (UTC) |
commit | 0a56adea03683be6066622bbbbae1f0b8c73db12 (patch) (side-by-side diff) | |
tree | 9b2ff9aabd303397edd12cd2589d7fb25315308c | |
parent | 4f6dbea16af4c6edb7cdc619be4cacf672f8aee8 (diff) | |
download | opie-0a56adea03683be6066622bbbbae1f0b8c73db12.zip opie-0a56adea03683be6066622bbbbae1f0b8c73db12.tar.gz opie-0a56adea03683be6066622bbbbae1f0b8c73db12.tar.bz2 |
dirty bugfix (segfault with scaleFactor > 1), see inside for more info
-rw-r--r-- | noncore/comm/keypebble/krfbbuffer.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/comm/keypebble/krfbbuffer.cpp b/noncore/comm/keypebble/krfbbuffer.cpp index 92918d4..4cec0c2 100644 --- a/noncore/comm/keypebble/krfbbuffer.cpp +++ b/noncore/comm/keypebble/krfbbuffer.cpp @@ -160,41 +160,43 @@ void KRFBBuffer::drawRawRectChunk( void *data, for ( int j = 0; j < h; j++ ) { for ( int i = 0; i < w ; i++ ) { CARD16 pixel = d[ j * w + i ]; pixel = Swap16IfLE( pixel ); r = pixel; r = r >> decoder->format->redShift; r = r & redMax; g = pixel; g = g >> decoder->format->greenShift; g = g & greenMax; b = pixel; b = b >> decoder->format->blueShift; b = b & blueMax; r = ( r * 255 ) / redMax; g = ( g * 255 ) / greenMax; b = ( b * 255 ) / blueMax; ulong *p = ( ulong * ) img.scanLine( j ) + i; *p = qRgb( r,g,b ); } } } else { p.setBrush( QBrush( Qt::black ) ); p.drawRect( x, y, w, h ); } if (scaleFactor > 1) { + /* FIXME: proper zero width/height handling */ + if (w/scaleFactor != 0) p.drawImage( x/scaleFactor, y/scaleFactor, img.smoothScale(w/scaleFactor,h/scaleFactor) ); emit updated( x/scaleFactor, y/scaleFactor, w/scaleFactor, h/scaleFactor ); } else { p.drawImage( x, y, img); emit updated( x, y, w, h ); } } |