From 52f43f946b41f210734e83e0712ee959a035f0a8 Mon Sep 17 00:00:00 2001 From: yanis60 Date: Sat, 30 Apr 2022 12:46:49 +0100 Subject: [PATCH] fixed border render when scaling --- limereport/lrbasedesignintf.cpp | 4 +++- limereport/lrpagedesignintf.cpp | 9 ++++---- limereport/lrpreviewreportwidget.cpp | 6 +++-- limereport/lrreportdesignwidget.cpp | 1 + translations/limereport_fr.ts | 34 ++++++++++++++-------------- translations/limereport_pl.ts | 34 ++++++++++++++-------------- 6 files changed, 47 insertions(+), 41 deletions(-) diff --git a/limereport/lrbasedesignintf.cpp b/limereport/lrbasedesignintf.cpp index 00c4931..73d4ade 100644 --- a/limereport/lrbasedesignintf.cpp +++ b/limereport/lrbasedesignintf.cpp @@ -1172,7 +1172,9 @@ QPen BaseDesignIntf::borderPen(BorderSide side/*, bool selected*/) const if (m_borderLinesFlags & side) { pen.setColor(m_borderColor); pen.setStyle(m_borderStyle); - pen.setWidthF(m_borderLineSize*1.333); + pen.setCosmetic(true); + pen.setWidthF(m_borderLineSize); + } else { pen.setColor(Qt::darkGray); pen.setStyle(Qt::SolidLine); diff --git a/limereport/lrpagedesignintf.cpp b/limereport/lrpagedesignintf.cpp index 6e7477b..2427d67 100644 --- a/limereport/lrpagedesignintf.cpp +++ b/limereport/lrpagedesignintf.cpp @@ -98,6 +98,7 @@ PageDesignIntf::PageDesignIntf(QObject *parent): updatePageRect(); connect(this, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged())); setBackgroundBrush(QBrush(Qt::white)); + } PageDesignIntf::~PageDesignIntf() @@ -355,7 +356,7 @@ void PageDesignIntf::mouseMoveEvent(QGraphicsSceneMouseEvent *event) ); } } else { - if (m_insertMode) m_itemInsertRect->setVisible(false); + if (m_insertMode) m_itemInsertRect->setVisible(false); } QGraphicsScene::mouseMoveEvent(event); @@ -751,7 +752,7 @@ void PageDesignIntf::dropEvent(QGraphicsSceneDragDropEvent* event) bool isVar = event->mimeData()->text().indexOf("variable:")==0; BaseDesignIntf* item = addReportItem("TextItem",event->scenePos(),QSize(250, 50)); TextItem* ti = dynamic_cast(item); - QString data = event->mimeData()->text().remove(0,event->mimeData()->text().indexOf(":")+1); + QString data = event->mimeData()->text().remove(0,event->mimeData()->text().indexOf(":")+1); #if (QT_VERSION < QT_VERSION_CHECK(5, 15, 1)) if (isVar) data = data.remove(QRegExp(" \\[.*\\]")); #else @@ -944,7 +945,7 @@ CommandIf::Ptr PageDesignIntf::createChangePosCommand() newPos.pos = reportItem->pos(); newPoses.append(newPos); } - } + } return PosChangedCommand::create(this, m_positionStamp, newPoses); } @@ -2651,7 +2652,7 @@ bool BandMoveFromToCommand::doIt() void BandMoveFromToCommand::undoIt() { if (page() && page()->pageItem()) - page()->pageItem()->moveBandFromTo(reverceFrom, reverceTo); + page()->pageItem()->moveBandFromTo(reverceFrom, reverceTo); } } diff --git a/limereport/lrpreviewreportwidget.cpp b/limereport/lrpreviewreportwidget.cpp index bed200e..4b2ff39 100644 --- a/limereport/lrpreviewreportwidget.cpp +++ b/limereport/lrpreviewreportwidget.cpp @@ -21,7 +21,7 @@ namespace LimeReport { bool PreviewReportWidgetPrivate::pageIsVisible(){ QGraphicsView* view = q_ptr->ui->graphicsView; - if ( m_currentPage-1 >= m_reportPages.size() || m_currentPage <= 0 ) + if ( m_currentPage-1 >= m_reportPages.size() || m_currentPage <= 0 ) return false; PageItemDesignIntf::Ptr page = m_reportPages.at(m_currentPage-1); return page->mapToScene(page->rect()).boundingRect().intersects( @@ -103,6 +103,7 @@ PreviewReportWidget::PreviewReportWidget(ReportEngine *report, QWidget *parent) d_ptr->m_zoomer = new GraphicsViewZoomer(ui->graphicsView); connect(d_ptr->m_zoomer, SIGNAL(zoomed(double)), this, SLOT(slotZoomed(double))); connect(&m_resizeTimer, SIGNAL(timeout()), this, SLOT(resizeDone())); + } PreviewReportWidget::~PreviewReportWidget() @@ -151,6 +152,7 @@ void PreviewReportWidget::initPreview() ui->graphicsView->centerOn(0, 0); ui->graphicsView->scene()->setBackgroundBrush(QColor(m_previewPageBackgroundColor)); setScalePercent(d_ptr->m_scalePercent); + PageDesignIntf* page = dynamic_cast(ui->graphicsView->scene()); if (page) connect(page, SIGNAL(itemInserted(LimeReport::PageDesignIntf*, QPointF, QString)), @@ -236,7 +238,7 @@ void PreviewReportWidget::printPages(QPrinter* printer) } void PreviewReportWidget::print() -{ +{ QPrinterInfo pi; QPrinter lp(QPrinter::HighResolution); diff --git a/limereport/lrreportdesignwidget.cpp b/limereport/lrreportdesignwidget.cpp index 6b7c608..19c3a3e 100644 --- a/limereport/lrreportdesignwidget.cpp +++ b/limereport/lrreportdesignwidget.cpp @@ -1119,6 +1119,7 @@ bool PageView::viewportEvent(QEvent *event) m_verticalRuller->setGeometry(0, y+20, 20, (height - y)); m_verticalRuller->update(); m_horizontalRuller->update(); + } break; default: diff --git a/translations/limereport_fr.ts b/translations/limereport_fr.ts index ea77d2d..bf7fd1d 100644 --- a/translations/limereport_fr.ts +++ b/translations/limereport_fr.ts @@ -554,53 +554,53 @@ p, li { white-space: pre-wrap; } LimeReport::BaseDesignIntf - - + + Lock item geometry Verrouiller la géométrie d'un élément - + Copy Copier - + Cut Couper - + Paste Coller - + Bring to top Placer au premier-plan - + Send to back Placer en arrière-plan - + Create Horizontal Layout Créer une disposition horizontale - + Create Vertical Layout Créer une disposition verticale - + No borders Aucune bordure - + All borders Toutes les bordures @@ -1740,12 +1740,12 @@ p, li { white-space: pre-wrap; } Formulaire - + %1 file name %1 nom de fichier - + Report file name Nom du fichier du rapport @@ -4185,14 +4185,14 @@ Cet aperçu n'est plus valide. - - + + Attention! - - + + Selected elements have different parent containers Les éléments sélectionnés ont un parent différent diff --git a/translations/limereport_pl.ts b/translations/limereport_pl.ts index 4d91f17..e6492dd 100644 --- a/translations/limereport_pl.ts +++ b/translations/limereport_pl.ts @@ -566,53 +566,53 @@ p, li { white-space: pre-wrap; } LimeReport::BaseDesignIntf - - + + Lock item geometry Zablokuj geometrię pozycji - + Copy Kopiuj - + Cut Wytnij - + Paste Wklej - + Bring to top Przenieś na górę - + Send to back Przenieś na dół - + Create Horizontal Layout Utwórz układ poziomy - + Create Vertical Layout Utwórz układ pionowy - + No borders Bez obramowania - + All borders Pełne obramowanie @@ -1752,12 +1752,12 @@ p, li { white-space: pre-wrap; } Formatka - + %1 file name %1 nazwa pliku - + Report file name Nazwa pliku raportu @@ -4197,14 +4197,14 @@ Ten podgląd nie jest już prawidłowy. Ciąg znaków - - + + Attention! Uwaga! - - + + Selected elements have different parent containers Wybrane elementy mają różne pojemniki nadrzędne