这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f7eae26
Match eraser dab behavior to eraser stroke behavior
scribblemaniac May 19, 2020
909976e
Fix deselect all action not updating view
scribblemaniac May 19, 2020
ace69d8
Remove useless code in quick sizing
scribblemaniac May 19, 2020
586e8d9
Rewrite quick size cursor display
scribblemaniac May 19, 2020
3b69bf1
Properly write the current frame when saving a project file
scribblemaniac May 28, 2020
8283e02
Change zoom slider focus policy
scribblemaniac May 29, 2020
305b26f
Merge branch 'master' of github.com:scribblemaniac/pencil into pre-re…
scribblemaniac May 29, 2020
66616c4
Remove multilayer onion skin action from menu
scribblemaniac May 29, 2020
d9760f5
Fix Recent File list wipe issue
scribblemaniac May 29, 2020
908388e
Allow new selection to be created by clicking and dragging outside of…
scribblemaniac May 29, 2020
8ac0e51
Round selection to the nearest pixel when on the bitmap layer
scribblemaniac May 30, 2020
ee82489
Improve center overlay rendering
scribblemaniac May 30, 2020
6bd0fb7
Disable selection actions in menu when there is no selection
scribblemaniac May 30, 2020
1b8a734
Change default project color
scribblemaniac May 30, 2020
5c47306
Fix many preset issues
scribblemaniac May 30, 2020
701dd95
Add possible workaround for #1017
scribblemaniac May 30, 2020
bfda42f
Move quick size handling to the tools
scribblemaniac May 30, 2020
0f69bb5
Add more information to ffmpeg error messages
scribblemaniac May 30, 2020
5eca8a1
Remove the import preview box from the export dialogs
scribblemaniac May 31, 2020
094a239
Fix some operations which ignored the draw on empty frame preference
scribblemaniac May 31, 2020
647d0de
Fix crash and incorrect color issues with eyedropper tool
scribblemaniac May 31, 2020
1cbd28b
Merge branch 'master' of github.com:pencil2d/pencil into pre-release-…
scribblemaniac Jun 3, 2020
049b2e6
Fix curve ordering for vector eyedropper
scribblemaniac Jun 3, 2020
60926db
Fix mac compiler errors
chchwy Jun 4, 2020
ec3cb53
Merge pull request #6 from chchwy/scribblemaniac-pre-release-fixes
scribblemaniac Jun 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/src/importexportdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ ImportExportDialog::ImportExportDialog(QWidget* parent, Mode eMode, FileType eFi

ui = new Ui::ImportExportDialog;
ui->setupUi(this);
hidePreviewGroupBox(true);
m_fileDialog = new FileDialog(this);
connect(ui->browseButton, &QPushButton::clicked, this, &ImportExportDialog::browse);

Expand Down
2 changes: 1 addition & 1 deletion app/src/importimageseqdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ void ImportImageSeqDialog::setupLayout()
{

hideInstructionsLabel(true);
hidePreviewGroupBox(true);

if (mFileType == FileType::GIF) {
setWindowTitle(tr("Import Animated GIF"));
Expand All @@ -70,6 +69,7 @@ void ImportImageSeqDialog::setupPredefinedLayout()
setInstructionsLabel(tr("Select an image that matches the criteria: MyFile000.png, eg. Joe001.png \n"
"The importer will search and find images matching the same criteria. You can see the result in the preview box below."));
hideOptionsGroupBox(true);
hidePreviewGroupBox(false);

connect(this, &ImportImageSeqDialog::filePathsChanged, this, &ImportImageSeqDialog::updatePreviewList);
}
Expand Down
45 changes: 28 additions & 17 deletions app/src/mainwindow2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ GNU General Public License for more details.
#include "layermanager.h"
#include "toolmanager.h"
#include "playbackmanager.h"
#include "selectionmanager.h"
#include "soundmanager.h"
#include "viewmanager.h"

Expand Down Expand Up @@ -121,6 +122,7 @@ MainWindow2::MainWindow2(QWidget* parent) :
readSettings();

updateZoomLabel();
selectionChanged();

connect(mEditor, &Editor::needSave, this, &MainWindow2::autoSave);
connect(mToolBox, &ToolBoxWidget::clearButtonClicked, mEditor, &Editor::clearCurrentFrame);
Expand All @@ -131,7 +133,7 @@ MainWindow2::MainWindow2(QWidget* parent) :

setWindowTitle(PENCIL_WINDOW_TITLE);

showPresetDialog();
tryLoadPreset();
}

MainWindow2::~MainWindow2()
Expand Down Expand Up @@ -271,6 +273,7 @@ void MainWindow2::createMenus()
connect(ui->actionCopy, &QAction::triggered, mEditor, &Editor::copy);
connect(ui->actionPaste, &QAction::triggered, mEditor, &Editor::paste);
connect(ui->actionClearFrame, &QAction::triggered, mEditor, &Editor::clearCurrentFrame);
connect(mEditor->select(), &SelectionManager::selectionChanged, this, &MainWindow2::selectionChanged);
connect(ui->actionFlip_X, &QAction::triggered, mCommands, &ActionCommands::flipSelectionX);
connect(ui->actionFlip_Y, &QAction::triggered, mCommands, &ActionCommands::flipSelectionY);
connect(ui->actionPegbarAlignment, &QAction::triggered, this, &MainWindow2::openPegAlignDialog);
Expand Down Expand Up @@ -316,7 +319,6 @@ void MainWindow2::createMenus()

bindActionWithSetting(ui->actionOnionPrev, SETTING::PREV_ONION);
bindActionWithSetting(ui->actionOnionNext, SETTING::NEXT_ONION);
bindActionWithSetting(ui->actionMultiLayerOnionSkin, SETTING::MULTILAYER_ONION);

//--- Animation Menu ---
PlaybackManager* pPlaybackManager = mEditor->playback();
Expand Down Expand Up @@ -434,6 +436,7 @@ void MainWindow2::clearRecentFilesList()
if (!recentFilesList.isEmpty())
{
mRecentFileMenu->clear();
mRecentFileMenu->saveToDisk();
QMessageBox::information(this, nullptr,
tr("\n\n You have successfully cleared the list"),
QMessageBox::Ok);
Expand Down Expand Up @@ -479,6 +482,12 @@ void MainWindow2::currentLayerChanged()
}
}

void MainWindow2::selectionChanged()
{
bool somethingSelected = mEditor->select()->somethingSelected();
ui->menuSelection->setEnabled(somethingSelected);
}

void MainWindow2::closeEvent(QCloseEvent* event)
{
if (m2ndCloseEvent)
Expand Down Expand Up @@ -516,18 +525,7 @@ void MainWindow2::newDocument(bool force)
}
else if (maybeSave())
{
if (mEditor->preference()->isOn(SETTING::ASK_FOR_PRESET))
{
showPresetDialog();
}
else
{
int defaultPreset = mEditor->preference()->getInt(SETTING::DEFAULT_PRESET);
newObjectFromPresets(defaultPreset);

setWindowTitle(PENCIL_WINDOW_TITLE);
updateSaveState();
}
tryLoadPreset();
}
}

Expand Down Expand Up @@ -660,8 +658,12 @@ bool MainWindow2::openObject(QString strFilePath)
QSettings settings(PENCIL2D, PENCIL2D);
settings.setValue(LAST_PCLX_PATH, object->filePath());

mRecentFileMenu->addRecentFile(object->filePath());
mRecentFileMenu->saveToDisk();
// Add to recent file list, but only if we are
if (!object->filePath().isEmpty())
{
mRecentFileMenu->addRecentFile(object->filePath());
mRecentFileMenu->saveToDisk();
}

setWindowTitle(object->filePath().prepend("[*]"));
setWindowModified(false);
Expand Down Expand Up @@ -1065,10 +1067,14 @@ bool MainWindow2::newObjectFromPresets(int presetIndex)
}
mEditor->setObject(object);
object->setFilePath(QString());

setWindowTitle(PENCIL_WINDOW_TITLE);
updateSaveState();

return true;
}

void MainWindow2::showPresetDialog()
void MainWindow2::tryLoadPreset()
{
if (mEditor->preference()->isOn(SETTING::ASK_FOR_PRESET))
{
Expand All @@ -1089,6 +1095,11 @@ void MainWindow2::showPresetDialog()
});
presetDialog->open();
}
else
{
int defaultPreset = mEditor->preference()->getInt(SETTING::DEFAULT_PRESET);
newObjectFromPresets(defaultPreset);
}
}

void MainWindow2::readSettings()
Expand Down
3 changes: 2 additions & 1 deletion app/src/mainwindow2.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public slots:
void openPegAlignDialog();
void closePegAlignDialog();
void currentLayerChanged();
void selectionChanged();

public:
void newDocument(bool force = false);
Expand Down Expand Up @@ -126,7 +127,7 @@ private slots:
void setupKeyboardShortcuts();
void clearKeyboardShortcuts();
void updateZoomLabel();
void showPresetDialog();
void tryLoadPreset();

void openPalette();
void importPalette();
Expand Down
5 changes: 2 additions & 3 deletions app/ui/mainwindow2.ui
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<x>0</x>
<y>0</y>
<width>831</width>
<height>41</height>
<height>24</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
Expand Down Expand Up @@ -135,7 +135,6 @@
</property>
<addaction name="actionOnionPrev"/>
<addaction name="actionOnionNext"/>
<addaction name="actionMultiLayerOnionSkin"/>
</widget>
<widget class="QMenu" name="menuZoom">
<property name="title">
Expand Down Expand Up @@ -825,7 +824,7 @@
<bool>true</bool>
</property>
<property name="text">
<string>MultiLayer Onion Skin</string>
<string>Multilayer Onion Skin</string>
</property>
</action>
<action name="actionLoopControl">
Expand Down
8 changes: 5 additions & 3 deletions core_lib/src/canvaspainter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,9 +586,11 @@ void CanvasPainter::paintOverlayCenter(QPainter &painter)
painter.setBrush(Qt::NoBrush);
painter.setRenderHint(QPainter::Antialiasing, false);

int offset = OVERLAY_SAFE_CENTER_CROSS_SIZE;
painter.drawLine(rect.center().x()-offset, rect.center().y(), rect.center().x()+offset, rect.center().y());
painter.drawLine(rect.center().x(), rect.center().y()-offset, rect.center().x(), rect.center().y()+offset);
QPoint offsetX(OVERLAY_SAFE_CENTER_CROSS_SIZE, 0), offsetY(0, OVERLAY_SAFE_CENTER_CROSS_SIZE);
painter.drawLine(rect.center(), rect.center() - offsetX);
painter.drawLine(rect.center(), rect.center() + offsetX);
painter.drawLine(rect.center(), rect.center() - offsetY);
painter.drawLine(rect.center(), rect.center() + offsetY);

painter.restore();
}
Expand Down
13 changes: 7 additions & 6 deletions core_lib/src/interface/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ void BackupBitmapElement::restore(Editor* editor)
{
Layer* layer = editor->object()->getLayer(this->layer);
auto selectMan = editor->select();
selectMan->setSelection(mySelection);
selectMan->setSelection(mySelection, true);
selectMan->setTransformedSelectionRect(myTransformedSelection);
selectMan->setTempTransformedSelectionRect(myTempTransformedSelection);
selectMan->setRotation(rotationAngle);
Expand Down Expand Up @@ -401,7 +401,7 @@ void BackupVectorElement::restore(Editor* editor)
{
Layer* layer = editor->object()->getLayer(this->layer);
auto selectMan = editor->select();
selectMan->setSelection(mySelection);
selectMan->setSelection(mySelection, false);
selectMan->setTransformedSelectionRect(myTransformedSelection);
selectMan->setTempTransformedSelectionRect(myTempTransformedSelection);
selectMan->setRotation(rotationAngle);
Expand Down Expand Up @@ -477,7 +477,7 @@ void Editor::undo()
if (layer->type() == Layer::VECTOR) {
VectorImage *vectorImage = static_cast<LayerVector*>(layer)->getVectorImageAtFrame(mFrame);
vectorImage->calculateSelectionRect();
select()->setSelection(vectorImage->getSelectionRect());
select()->setSelection(vectorImage->getSelectionRect(), false);
}
emit updateBackup();
}
Expand Down Expand Up @@ -584,15 +584,17 @@ void Editor::paste()
}
}
auto pLayerBitmap = static_cast<LayerBitmap*>(layer);
mScribbleArea->handleDrawingOnEmptyFrame();
pLayerBitmap->getLastBitmapImageAtFrame(currentFrame(), 0)->paste(&tobePasted); // paste the clipboard
}
else if (layer->type() == Layer::VECTOR && clipboardVectorOk)
{
backup(tr("Paste"));
deselectAll();
mScribbleArea->handleDrawingOnEmptyFrame();
VectorImage* vectorImage = (static_cast<LayerVector*>(layer))->getLastVectorImageAtFrame(currentFrame(), 0);
vectorImage->paste(g_clipboardVectorImage); // paste the clipboard
select()->setSelection(vectorImage->getSelectionRect());
select()->setSelection(vectorImage->getSelectionRect(), false);
}
}
mScribbleArea->updateCurrentFrame();
Expand Down Expand Up @@ -966,8 +968,7 @@ void Editor::selectAll()
vectorImage->selectAll();
rect = vectorImage->getSelectionRect();
}
select()->setSelection(rect);
emit updateCurrentFrame();
select()->setSelection(rect, false);
}

void Editor::deselectAll()
Expand Down
9 changes: 6 additions & 3 deletions core_lib/src/interface/recentfilemenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ void RecentFileMenu::clear()
mRecentFiles.clear();
mRecentActions.clear();
addAction(mEmptyAction);
saveToDisk();
}

void RecentFileMenu::setRecentFiles(const QStringList& filenames)
{
clear();

// Iterate in reverse because items are prepended to the list when first added
for (auto filename = filenames.crbegin(); filename != filenames.crend(); filename++)
{
if (*filename != "")
if (!filename->isEmpty())
{
addRecentFile(*filename);
}
Expand Down Expand Up @@ -114,7 +114,10 @@ void RecentFileMenu::addRecentFile(QString filename)
addAction(action);
addAction(mClearSeparator);
addAction(mClearAction);
QObject::connect(mClearAction, &QAction::triggered, this, &RecentFileMenu::clear);
QObject::connect(mClearAction, &QAction::triggered, [this] {
clear();
saveToDisk();
});
}
else
{
Expand Down
Loading