[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/KDE/4.3/kdelibs/kate/utils
From: Dominik Haumann <dhdev () gmx ! de>
Date: 2010-01-03 0:32:31
Message-ID: 1262478751.271081.15679.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1069227 by dhaumann:
backport SVN commit 1067616 by pletourn:
Fix printing when a line is split between 2 pages
CCBUG: 219598
M +13 -8 kateprinter.cpp
--- branches/KDE/4.3/kdelibs/kate/utils/kateprinter.cpp #1069226:1069227
@@ -609,20 +609,25 @@
// If the line is too long (too many 'viewlines') to fit the remaining \
vertical space, // clip and adjust the painter position as necessary
- int _lines = (*rangeptr)->viewLineCount()-remainder; // number of "sublines" \
to paint.
- int _yadjust = remainder * fontHeight; // if we need to clip at the start of \
the line, it's this much.
- bool _needWrap = (fontHeight*_lines > maxHeight-y);
+ int _lines = (*rangeptr)->viewLineCount(); // number of "sublines" to paint.
- if (remainder || _needWrap) {
- remainder = _needWrap? _lines - ((maxHeight-y)/fontHeight) : 0;
- paint.translate(0, -_yadjust);
- paint.setClipRect(0,_yadjust,maxWidth,((_lines-remainder)*fontHeight)-1); \
//### drop the crosspatch in printerfriendly mode??? + if (remainder) {
+ int _height = (maxHeight-y)/fontHeight;
+ _height = qMin(_height, remainder);
+
+ paint.translate(0, -(_lines-remainder)*fontHeight+1);
+ paint.setClipRect(0, (_lines-remainder)*fontHeight+1, maxWidth, \
_height*fontHeight); //### drop the crosspatch in printerfriendly mode??? + \
remainder -= _height; }
+ else if (fontHeight*_lines > maxHeight-y) {
+ remainder = _lines - ((maxHeight-y)/fontHeight);
+ paint.setClipRect(0, 0, maxWidth, (_lines-remainder)*fontHeight+1); //### \
drop the crosspatch in printerfriendly mode??? + }
renderer.paintTextLine(paint, *rangeptr, 0, (int)maxWidth);
paint.setClipping(false);
- paint.translate(_xadjust, (fontHeight * _lines)+_yadjust);
+ paint.translate(_xadjust, (fontHeight * _lines));
y += fontHeight*_lines;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic