print dialog issue
Angelo Naselli <[email protected]>
| Newsgroups | gmane.comp.kde.gwenview |
|---|---|
| Message-ID | <[email protected]> |
Hi, I was reviewing our code and testing it I saw there are some problems: 1) if keep ratio is enabled and it is the first time, wxh is 0.0x0.0, I know the ratio is kept, but i don't like it so the attached patch should solve the problem. 2) if you want to scale the image the setting is saved but not restored, and since I wrote that code to use it i have to fix it ;) Anyway that's weird, I cannot understand why, the code seems to be ok, the only way to fix i found is to change the mScale buttonGroupId, for instance with the mFitToPage one in ui file (1<->2) or setting mScale as default. Before doing this change I'd like to hear something more, can anyone test and explain why? Thanks Angelo ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Gwenview-general mailing list Gwenview-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/gwenview-general
printdialog.patch
(text/x-diff, 875 B)
Index: printdialog.cpp
===================================================================
--- printdialog.cpp (revisione 616751)
+++ printdialog.cpp (copia locale)
@@ -250,12 +250,17 @@
void PrintDialogPage::toggleRatio(bool enable) {
if (!enable) return;
+ // choosing a startup value of 15x10 cm (common photo dimention)
+ // mContent->mHeight->value() or mContent->mWidth->value()
+ // are usually empty at startup and hxw (0x0) isn't good IMO keeping ratio
double hValue, wValue;
if (mDocument->height() > mDocument->width()) {
hValue = mContent->mHeight->value();
+ if (!hValue) hValue = 150*unitToMM(mPreviousUnit);
wValue = (mDocument->width() * hValue)/ mDocument->height();
} else {
wValue = mContent->mWidth->value();
+ if (!wValue) wValue = 150*unitToMM(mPreviousUnit);
hValue = (mDocument->height() * wValue)/ mDocument->width();
}
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQBFkY0TqEs9DA4DquARAoFUAKCrCiWPEzV4p7xkFq/7UMjjKDih7ACfROgE BnZ9tfHE+U7akggqzqTf8pY= =mwl1 -----END PGP SIGNATURE-----