? .DS_Store ? Info.plist ? LPub4.xcodeproj ? build ? lpub-transparency.patch ? moc ? objs ? rcc ? ui_preferences.h Index: backgrounditem.cpp =================================================================== RCS file: /cvsroot/lpub4/LPub4/LPub4/backgrounditem.cpp,v retrieving revision 1.9 diff -u -r1.9 backgrounditem.cpp --- backgrounditem.cpp 19 Sep 2010 18:27:41 -0000 1.9 +++ backgrounditem.cpp 9 Dec 2013 22:04:29 -0000 @@ -98,6 +98,7 @@ } break; case BackgroundData::BgTransparent: + brushColor = Qt::transparent; break; case BackgroundData::BgColor: case BackgroundData::BgSubmodelColor: Index: meta.cpp =================================================================== RCS file: /cvsroot/lpub4/LPub4/LPub4/meta.cpp,v retrieving revision 1.40 diff -u -r1.40 meta.cpp --- meta.cpp 14 Sep 2011 12:30:16 -0000 1.40 +++ meta.cpp 9 Dec 2013 22:04:29 -0000 @@ -830,8 +830,7 @@ QString foo; switch (_value[pushed].type) { case BackgroundData::BgTransparent: -//line was foo = "TRANSPARENT"; // Set this value to "COLOR \"#FFFFFF\"" for white background - Jaco - foo = "COLOR \"#FFFFFF\""; + foo = "TRANSPARENT"; break; case BackgroundData::BgSubmodelColor: foo = "SUBMODEL_BACKGROUND_COLOR"; @@ -859,7 +858,7 @@ BackgroundData background = value(); switch (background.type) { case BackgroundData::BgTransparent: - return "Transparent (white)"; // Set this text to "Transparent (white)" - Jaco + return "Transparent"; break; case BackgroundData::BgImage: return "Picture " + background.string; Index: metagui.cpp =================================================================== RCS file: /cvsroot/lpub4/LPub4/LPub4/metagui.cpp,v retrieving revision 1.16 diff -u -r1.16 metagui.cpp --- metagui.cpp 14 Sep 2011 12:30:16 -0000 1.16 +++ metagui.cpp 9 Dec 2013 22:04:29 -0000 @@ -695,7 +695,7 @@ parent->setLayout(grid); combo = new QComboBox(parent); - combo->addItem("None (white)"); // Set this text to "None (white)" - Jaco + combo->addItem("None (transparent)"); combo->addItem("Picture"); combo->addItem("Solid Color"); combo->addItem("Submodel Level Color"); @@ -786,7 +786,7 @@ { BackgroundData background = meta->value(); - if (type == "None (white)") { // Set this text to "None (white)" - Jaco + if (type == "None (transparent)") { background.type = BackgroundData::BgTransparent; } else if (type == "Picture") { background.type = BackgroundData::BgImage; Index: printpdf.cpp =================================================================== RCS file: /cvsroot/lpub4/LPub4/LPub4/printpdf.cpp,v retrieving revision 1.18 diff -u -r1.18 printpdf.cpp --- printpdf.cpp 26 Sep 2010 20:30:23 -0000 1.18 +++ printpdf.cpp 9 Dec 2013 22:04:29 -0000 @@ -307,13 +307,23 @@ view.centerOn(boundingRect.center()); // view.fitInView(boundingRect); clearPage(&view, &scene); + + // Support transparency for formats that can handle it, but use white for those that can't. + QColor fill = (suffix.compare(".png", Qt::CaseInsensitive) == 0) ? Qt::transparent : Qt::white; int savePageNumber = displayPageNum; for (displayPageNum = 1; displayPageNum <= maxPages; displayPageNum++) { //qApp->processEvents(); + // clear the pixels of the image, just in case the background is + // transparent or uses a PNG image with transparency. This will + // prevent rendered pixels from each page layering on top of each + // other. + image.fill(fill); + // render this page + // scene.render instead of view.render resolves "warm up" issue drawPage(&view,&scene,false); scene.setSceneRect(0.0,0.0,pageWidthPx,pageHeightPx);