0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-24 08:34:38 +03:00

fixed border render when scaling

This commit is contained in:
yanis60 2022-04-30 12:46:49 +01:00
parent cb66b1fd2a
commit 52f43f946b
6 changed files with 47 additions and 41 deletions

View File

@ -1172,7 +1172,9 @@ QPen BaseDesignIntf::borderPen(BorderSide side/*, bool selected*/) const
if (m_borderLinesFlags & side) { if (m_borderLinesFlags & side) {
pen.setColor(m_borderColor); pen.setColor(m_borderColor);
pen.setStyle(m_borderStyle); pen.setStyle(m_borderStyle);
pen.setWidthF(m_borderLineSize*1.333); pen.setCosmetic(true);
pen.setWidthF(m_borderLineSize);
} else { } else {
pen.setColor(Qt::darkGray); pen.setColor(Qt::darkGray);
pen.setStyle(Qt::SolidLine); pen.setStyle(Qt::SolidLine);

View File

@ -98,6 +98,7 @@ PageDesignIntf::PageDesignIntf(QObject *parent):
updatePageRect(); updatePageRect();
connect(this, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged())); connect(this, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged()));
setBackgroundBrush(QBrush(Qt::white)); setBackgroundBrush(QBrush(Qt::white));
} }
PageDesignIntf::~PageDesignIntf() PageDesignIntf::~PageDesignIntf()
@ -355,7 +356,7 @@ void PageDesignIntf::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
); );
} }
} else { } else {
if (m_insertMode) m_itemInsertRect->setVisible(false); if (m_insertMode) m_itemInsertRect->setVisible(false);
} }
QGraphicsScene::mouseMoveEvent(event); QGraphicsScene::mouseMoveEvent(event);
@ -2651,7 +2652,7 @@ bool BandMoveFromToCommand::doIt()
void BandMoveFromToCommand::undoIt() void BandMoveFromToCommand::undoIt()
{ {
if (page() && page()->pageItem()) if (page() && page()->pageItem())
page()->pageItem()->moveBandFromTo(reverceFrom, reverceTo); page()->pageItem()->moveBandFromTo(reverceFrom, reverceTo);
} }
} }

View File

@ -21,7 +21,7 @@ namespace LimeReport {
bool PreviewReportWidgetPrivate::pageIsVisible(){ bool PreviewReportWidgetPrivate::pageIsVisible(){
QGraphicsView* view = q_ptr->ui->graphicsView; 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; return false;
PageItemDesignIntf::Ptr page = m_reportPages.at(m_currentPage-1); PageItemDesignIntf::Ptr page = m_reportPages.at(m_currentPage-1);
return page->mapToScene(page->rect()).boundingRect().intersects( 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); d_ptr->m_zoomer = new GraphicsViewZoomer(ui->graphicsView);
connect(d_ptr->m_zoomer, SIGNAL(zoomed(double)), this, SLOT(slotZoomed(double))); connect(d_ptr->m_zoomer, SIGNAL(zoomed(double)), this, SLOT(slotZoomed(double)));
connect(&m_resizeTimer, SIGNAL(timeout()), this, SLOT(resizeDone())); connect(&m_resizeTimer, SIGNAL(timeout()), this, SLOT(resizeDone()));
} }
PreviewReportWidget::~PreviewReportWidget() PreviewReportWidget::~PreviewReportWidget()
@ -151,6 +152,7 @@ void PreviewReportWidget::initPreview()
ui->graphicsView->centerOn(0, 0); ui->graphicsView->centerOn(0, 0);
ui->graphicsView->scene()->setBackgroundBrush(QColor(m_previewPageBackgroundColor)); ui->graphicsView->scene()->setBackgroundBrush(QColor(m_previewPageBackgroundColor));
setScalePercent(d_ptr->m_scalePercent); setScalePercent(d_ptr->m_scalePercent);
PageDesignIntf* page = dynamic_cast<PageDesignIntf*>(ui->graphicsView->scene()); PageDesignIntf* page = dynamic_cast<PageDesignIntf*>(ui->graphicsView->scene());
if (page) if (page)
connect(page, SIGNAL(itemInserted(LimeReport::PageDesignIntf*, QPointF, QString)), connect(page, SIGNAL(itemInserted(LimeReport::PageDesignIntf*, QPointF, QString)),

View File

@ -1119,6 +1119,7 @@ bool PageView::viewportEvent(QEvent *event)
m_verticalRuller->setGeometry(0, y+20, 20, (height - y)); m_verticalRuller->setGeometry(0, y+20, 20, (height - y));
m_verticalRuller->update(); m_verticalRuller->update();
m_horizontalRuller->update(); m_horizontalRuller->update();
} }
break; break;
default: default:

View File

@ -554,53 +554,53 @@ p, li { white-space: pre-wrap; }
<context> <context>
<name>LimeReport::BaseDesignIntf</name> <name>LimeReport::BaseDesignIntf</name>
<message> <message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1383"/> <location filename="../limereport/lrbasedesignintf.cpp" line="1385"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1811"/> <location filename="../limereport/lrbasedesignintf.cpp" line="1813"/>
<source>Lock item geometry</source> <source>Lock item geometry</source>
<translation>Verrouiller la géométrie d&apos;un élément</translation> <translation>Verrouiller la géométrie d&apos;un élément</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1389"/> <location filename="../limereport/lrbasedesignintf.cpp" line="1391"/>
<source>Copy</source> <source>Copy</source>
<translation>Copier</translation> <translation>Copier</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1391"/> <location filename="../limereport/lrbasedesignintf.cpp" line="1393"/>
<source>Cut</source> <source>Cut</source>
<translation>Couper</translation> <translation>Couper</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1393"/> <location filename="../limereport/lrbasedesignintf.cpp" line="1395"/>
<source>Paste</source> <source>Paste</source>
<translation>Coller</translation> <translation>Coller</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1403"/> <location filename="../limereport/lrbasedesignintf.cpp" line="1405"/>
<source>Bring to top</source> <source>Bring to top</source>
<translation>Placer au premier-plan</translation> <translation>Placer au premier-plan</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1404"/> <location filename="../limereport/lrbasedesignintf.cpp" line="1406"/>
<source>Send to back</source> <source>Send to back</source>
<translation>Placer en arrière-plan</translation> <translation>Placer en arrière-plan</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1407"/> <location filename="../limereport/lrbasedesignintf.cpp" line="1409"/>
<source>Create Horizontal Layout</source> <source>Create Horizontal Layout</source>
<translation>Créer une disposition horizontale</translation> <translation>Créer une disposition horizontale</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1411"/> <location filename="../limereport/lrbasedesignintf.cpp" line="1413"/>
<source>Create Vertical Layout</source> <source>Create Vertical Layout</source>
<translation>Créer une disposition verticale</translation> <translation>Créer une disposition verticale</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1414"/> <location filename="../limereport/lrbasedesignintf.cpp" line="1416"/>
<source>No borders</source> <source>No borders</source>
<translation>Aucune bordure</translation> <translation>Aucune bordure</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1415"/> <location filename="../limereport/lrbasedesignintf.cpp" line="1417"/>
<source>All borders</source> <source>All borders</source>
<translation>Toutes les bordures</translation> <translation>Toutes les bordures</translation>
</message> </message>
@ -1740,12 +1740,12 @@ p, li { white-space: pre-wrap; }
<translation>Formulaire</translation> <translation>Formulaire</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrpreviewreportwidget.cpp" line="129"/> <location filename="../limereport/lrpreviewreportwidget.cpp" line="130"/>
<source>%1 file name</source> <source>%1 file name</source>
<translation>%1 nom de fichier</translation> <translation>%1 nom de fichier</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrpreviewreportwidget.cpp" line="288"/> <location filename="../limereport/lrpreviewreportwidget.cpp" line="289"/>
<source>Report file name</source> <source>Report file name</source>
<translation>Nom du fichier du rapport</translation> <translation>Nom du fichier du rapport</translation>
</message> </message>
@ -4185,14 +4185,14 @@ Cet aperçu n&apos;est plus valide.</translation>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrpagedesignintf.cpp" line="1675"/> <location filename="../limereport/lrpagedesignintf.cpp" line="1676"/>
<location filename="../limereport/lrpagedesignintf.cpp" line="1717"/> <location filename="../limereport/lrpagedesignintf.cpp" line="1718"/>
<source>Attention!</source> <source>Attention!</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrpagedesignintf.cpp" line="1675"/> <location filename="../limereport/lrpagedesignintf.cpp" line="1676"/>
<location filename="../limereport/lrpagedesignintf.cpp" line="1717"/> <location filename="../limereport/lrpagedesignintf.cpp" line="1718"/>
<source>Selected elements have different parent containers</source> <source>Selected elements have different parent containers</source>
<translation>Les éléments sélectionnés ont un parent différent</translation> <translation>Les éléments sélectionnés ont un parent différent</translation>
</message> </message>

View File

@ -566,53 +566,53 @@ p, li { white-space: pre-wrap; }
<context> <context>
<name>LimeReport::BaseDesignIntf</name> <name>LimeReport::BaseDesignIntf</name>
<message> <message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1383"/> <location filename="../limereport/lrbasedesignintf.cpp" line="1385"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1811"/> <location filename="../limereport/lrbasedesignintf.cpp" line="1813"/>
<source>Lock item geometry</source> <source>Lock item geometry</source>
<translation>Zablokuj geometrię pozycji</translation> <translation>Zablokuj geometrię pozycji</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1389"/> <location filename="../limereport/lrbasedesignintf.cpp" line="1391"/>
<source>Copy</source> <source>Copy</source>
<translation>Kopiuj</translation> <translation>Kopiuj</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1391"/> <location filename="../limereport/lrbasedesignintf.cpp" line="1393"/>
<source>Cut</source> <source>Cut</source>
<translation>Wytnij</translation> <translation>Wytnij</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1393"/> <location filename="../limereport/lrbasedesignintf.cpp" line="1395"/>
<source>Paste</source> <source>Paste</source>
<translation>Wklej</translation> <translation>Wklej</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1403"/> <location filename="../limereport/lrbasedesignintf.cpp" line="1405"/>
<source>Bring to top</source> <source>Bring to top</source>
<translation>Przenieś na górę</translation> <translation>Przenieś na górę</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1404"/> <location filename="../limereport/lrbasedesignintf.cpp" line="1406"/>
<source>Send to back</source> <source>Send to back</source>
<translation>Przenieś na dół</translation> <translation>Przenieś na dół</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1407"/> <location filename="../limereport/lrbasedesignintf.cpp" line="1409"/>
<source>Create Horizontal Layout</source> <source>Create Horizontal Layout</source>
<translation>Utwórz układ poziomy</translation> <translation>Utwórz układ poziomy</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1411"/> <location filename="../limereport/lrbasedesignintf.cpp" line="1413"/>
<source>Create Vertical Layout</source> <source>Create Vertical Layout</source>
<translation>Utwórz układ pionowy</translation> <translation>Utwórz układ pionowy</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1414"/> <location filename="../limereport/lrbasedesignintf.cpp" line="1416"/>
<source>No borders</source> <source>No borders</source>
<translation>Bez obramowania</translation> <translation>Bez obramowania</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1415"/> <location filename="../limereport/lrbasedesignintf.cpp" line="1417"/>
<source>All borders</source> <source>All borders</source>
<translation>Pełne obramowanie</translation> <translation>Pełne obramowanie</translation>
</message> </message>
@ -1752,12 +1752,12 @@ p, li { white-space: pre-wrap; }
<translation>Formatka</translation> <translation>Formatka</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrpreviewreportwidget.cpp" line="129"/> <location filename="../limereport/lrpreviewreportwidget.cpp" line="130"/>
<source>%1 file name</source> <source>%1 file name</source>
<translation>%1 nazwa pliku</translation> <translation>%1 nazwa pliku</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrpreviewreportwidget.cpp" line="288"/> <location filename="../limereport/lrpreviewreportwidget.cpp" line="289"/>
<source>Report file name</source> <source>Report file name</source>
<translation>Nazwa pliku raportu</translation> <translation>Nazwa pliku raportu</translation>
</message> </message>
@ -4197,14 +4197,14 @@ Ten podgląd nie jest już prawidłowy.</translation>
<translation>Ciąg znaków</translation> <translation>Ciąg znaków</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrpagedesignintf.cpp" line="1675"/> <location filename="../limereport/lrpagedesignintf.cpp" line="1676"/>
<location filename="../limereport/lrpagedesignintf.cpp" line="1717"/> <location filename="../limereport/lrpagedesignintf.cpp" line="1718"/>
<source>Attention!</source> <source>Attention!</source>
<translation>Uwaga!</translation> <translation>Uwaga!</translation>
</message> </message>
<message> <message>
<location filename="../limereport/lrpagedesignintf.cpp" line="1675"/> <location filename="../limereport/lrpagedesignintf.cpp" line="1676"/>
<location filename="../limereport/lrpagedesignintf.cpp" line="1717"/> <location filename="../limereport/lrpagedesignintf.cpp" line="1718"/>
<source>Selected elements have different parent containers</source> <source>Selected elements have different parent containers</source>
<translation>Wybrane elementy mają różne pojemniki nadrzędne</translation> <translation>Wybrane elementy mają różne pojemniki nadrzędne</translation>
</message> </message>