Skip to content

Commit

Permalink
fixed a segfault after font editing when the edited glyph is located …
Browse files Browse the repository at this point in the history
…on a sheet and a sheet is resized.
  • Loading branch information
aizenbit committed Nov 19, 2016
1 parent f1df3ee commit 019cd07
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ MainWindow::MainWindow(QWidget *parent) :
this, SLOT(renderNextSheet()));

connect(fontDialog, SIGNAL(fontReady()),
ui->svgView, SLOT(loadFont()));
this, SLOT(updateCurrentSheet()));
errorMessage->setModal(true);

ui->toolBar->actions()[ToolButton::Render]->setShortcut(Qt::ControlModifier + Qt::Key_R);
Expand Down Expand Up @@ -278,6 +278,13 @@ void MainWindow::renderPreviousSheet()
showSheetNumber(currentSheetNumber);
}

void MainWindow::updateCurrentSheet()
{
ui->svgView->loadFont();
int lettersToTheEnd = text.length() - sheetPointers.at(currentSheetNumber);
ui->svgView->renderText(QStringRef(&text, sheetPointers.at(currentSheetNumber), lettersToTheEnd));
}

void MainWindow::loadFont()
{
QString fileName = QFileDialog::getOpenFileName(0, tr("Open"), "",
Expand Down
1 change: 1 addition & 0 deletions mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ private slots:
void renderFirstSheet();
void renderNextSheet();
void renderPreviousSheet();
void updateCurrentSheet();
void loadFont();
void saveSheet(QString fileName = QString());
void saveAllSheets();
Expand Down

0 comments on commit 019cd07

Please sign in to comment.