[Kst] kdeextragear-2/kst/kst
Barth Netterfield
netterfield at astro.utoronto.ca
Fri Jul 2 23:07:09 CEST 2004
CVS commit by netterfield:
Graphics File Export now ~ works.
There are still some aliasing problems related to aspect rounding I think.
M +2 -2 kst.cpp 1.171
M +10 -2 kst2dplot.cpp 1.129
M +1 -1 kstviewobject.h 1.60
M +2 -2 kstviewwindow.cpp 1.19
--- kdeextragear-2/kst/kst/kst.cpp #1.170:1.171
@@ -983,5 +983,5 @@ void KstApp::slotFilePrint() {
pView->view()->resize(size);
paint.drawText(rect, Qt::AlignLeft | Qt::AlignVCenter, strTitle);
- pView->view()->paint(P_EXPORT, paint);
+ pView->view()->paint(P_PRINT, paint);
pView->view()->resize(sizeOld);
@@ -1043,5 +1043,5 @@ void KstApp::immediatePrintToFile(const
pView->view()->resize(size);
paint.drawText( rect, Qt::AlignLeft | Qt::AlignVCenter, strTitle );
- pView->view()->paint(P_EXPORT, paint);
+ pView->view()->paint(P_PRINT, paint);
pView->view()->resize(sizeOld);
--- kdeextragear-2/kst/kst/kst2dplot.cpp #1.128:1.129
@@ -901,10 +901,18 @@ void Kst2DPlot::updateTieBox(QPainter& p
void Kst2DPlot::paint(KstPaintType type, QPainter& p) {
- if (type == P_EXPORT) {
+ if ((type == P_EXPORT) || (type == P_PRINT)) {
+// printf("s: %d %d %d %d\n", p.viewport().width(), p.viewport().height(),
+// geometry().width(), geometry().height());
+// printf("g: %d %d %d %d\n", geometry().left(), geometry().top(),
+// geometry().width(), geometry().height());
QRect window_hold = p.window();
QRect viewport_hold = p.viewport();
p.setViewport(geometry().left(), geometry().top(),
geometry().width(), geometry().height());
+ if (type == P_PRINT) {
draw(p, 5);
+ } else {
+ draw(p);
+ }
p.setWindow(window_hold);
p.setViewport(viewport_hold);
--- kdeextragear-2/kst/kst/kstviewobject.h #1.59:1.60
@@ -46,5 +46,5 @@ typedef KstViewObjectPtr (*KstViewObject
// P_PLOT: data didn't change
// P_DATA: data changed
-typedef enum { P_PAINT, P_DATA, P_PLOT, P_ZOOM, P_EXPORT } KstPaintType;
+typedef enum { P_PAINT, P_DATA, P_PLOT, P_ZOOM, P_PRINT, P_EXPORT } KstPaintType;
struct KstAspectRatio {
--- kdeextragear-2/kst/kst/kstviewwindow.cpp #1.18:1.19
@@ -188,5 +188,5 @@ void KstViewWindow::slotFilePrint() {
sizeOld = view()->size();
view()->resize(size);
- view()->paint(P_EXPORT, paint);
+ view()->paint(P_PRINT, paint);
view()->resize(sizeOld);
@@ -212,5 +212,5 @@ void KstViewWindow::immediatePrintToFile
sizeOld = view()->size();
view()->resize(size);
- view()->paint(P_EXPORT, paint);
+ view()->paint(P_PRINT, paint);
view()->resize(sizeOld);
}
More information about the Kst
mailing list