Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
chchwy committed Jul 2, 2020
1 parent 91f0b97 commit 099a2b5
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 36 deletions.
2 changes: 1 addition & 1 deletion core_lib/src/interface/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ void Editor::updateObject()
{
mScribbleArea->updateAllFrames();
}

if (mPreferenceManager)
{
mObject->setActiveFramePoolSize(mPreferenceManager->getInt(SETTING::FRAME_POOL_SIZE));
Expand Down
14 changes: 4 additions & 10 deletions core_lib/src/interface/scribblearea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1334,10 +1334,7 @@ QPointF ScribbleArea::getCentralPoint()
void ScribbleArea::paintTransformedSelection()
{
Layer* layer = mEditor->layers()->currentLayer();
if (layer == nullptr)
{
return;
}
if (layer == nullptr) { return; }

auto selectMan = mEditor->select();
if (selectMan->somethingSelected()) // there is something selected
Expand Down Expand Up @@ -1388,10 +1385,7 @@ void ScribbleArea::applyTransformedSelection()
mCanvasPainter.ignoreTransformedSelection();

Layer* layer = mEditor->layers()->currentLayer();
if (layer == nullptr)
{
return;
}
if (layer == nullptr) { return; }

auto selectMan = mEditor->select();
if (selectMan->somethingSelected())
Expand Down Expand Up @@ -1434,8 +1428,8 @@ void ScribbleArea::cancelTransformedSelection()
Layer* layer = mEditor->layers()->currentLayer();
if (layer == nullptr) { return; }

if (layer->type() == Layer::VECTOR) {

if (layer->type() == Layer::VECTOR)
{
VectorImage* vectorImage = currentVectorImage(layer);
if (vectorImage != nullptr)
{
Expand Down
1 change: 0 additions & 1 deletion core_lib/src/managers/layermanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ bool LayerManager::init()

Status LayerManager::load(Object* o)
{
Q_UNUSED(o);

This comment has been minimized.

Copy link
@scribblemaniac

scribblemaniac Jul 3, 2020

Member

That was there for a reason. Now, it will produce a warning because the parameter o is unused.

This comment has been minimized.

Copy link
@chchwy

chchwy Jul 4, 2020

Author Member

Sorry, I was using that o but then removed it. Will add it back.

mLastCameraLayerIdx = 0;
// Do not emit layerCountChanged here because the editor has not updated to this object yet
// Leave that to the caller of this function
Expand Down
2 changes: 1 addition & 1 deletion core_lib/src/structure/objectdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ GNU General Public License for more details.

ObjectData::ObjectData()
{
QSettings settings(PENCIL2D,PENCIL2D);
QSettings settings(PENCIL2D, PENCIL2D);
mFps = settings.value(SETTING_FPS).toInt();
if (mFps < 1)
mFps = 12;
Expand Down
46 changes: 23 additions & 23 deletions core_lib/src/structure/objectdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,48 +29,48 @@ class ObjectData
public:
ObjectData();

void setCurrentFrame( int n ) { mCurrentFrame = n; }

This comment has been minimized.

Copy link
@scribblemaniac

scribblemaniac Jul 3, 2020

Member

I don't think you should not be bothering with all of these things. Basically all of these stylistic changes will be automatically overwritten when #1270 is implemented.

int getCurrentFrame() const { return mCurrentFrame; }
void setCurrentFrame(int n) { mCurrentFrame = n; }
int getCurrentFrame() const { return mCurrentFrame; }

void setCurrentColor( QColor c ) { mCurrentColor = c; }
QColor getCurrentColor() const { return mCurrentColor; }
void setCurrentColor(QColor c) { mCurrentColor = c; }
QColor getCurrentColor() const { return mCurrentColor; }

void setCurrentLayer( int n ) { mCurrentLayer = n; }
int getCurrentLayer() const { return mCurrentLayer; }
void setCurrentLayer(int n) { mCurrentLayer = n; }
int getCurrentLayer() const { return mCurrentLayer; }

void setCurrentView( QTransform t ) { mCurrentView = t; }
QTransform getCurrentView() const { return mCurrentView; }
void setCurrentView(QTransform t) { mCurrentView = t; }
QTransform getCurrentView() const { return mCurrentView; }

void setFrameRate( int n ) { mFps = n; }
int getFrameRate() const { return mFps; }

void setLooping( bool b ) { mIsLoop = b; }
bool isLooping() const { return mIsLoop; }
void setFrameRate(int n) { mFps = n; }
int getFrameRate() const { return mFps; }

void setRangedPlayback( bool b ) { mIsRangedPlayback = b; }
bool isRangedPlayback() const { return mIsRangedPlayback; }
void setLooping(bool b) { mIsLoop = b; }
bool isLooping() const { return mIsLoop; }

void setMarkInFrameNumber( int n ) { mMarkInFrame = n; }
int getMarkInFrameNumber() const { return mMarkInFrame; }
void setRangedPlayback(bool b) { mIsRangedPlayback = b; }
bool isRangedPlayback() const { return mIsRangedPlayback; }

void setMarkOutFrameNumber( int n ) { mMarkOutFrame = n; }
int getMarkOutFrameNumber() const { return mMarkOutFrame; }
void setMarkInFrameNumber(int n) { mMarkInFrame = n; }
int getMarkInFrameNumber() const { return mMarkInFrame; }

void setMarkOutFrameNumber(int n) { mMarkOutFrame = n; }
int getMarkOutFrameNumber() const { return mMarkOutFrame; }

private:
int mCurrentFrame = 1;
int mCurrentFrame = 1;
QColor mCurrentColor{ 0, 0, 0, 255 };
int mCurrentLayer = 2; // Layers are counted bottom up
int mCurrentLayer = 2; // Layers are counted bottom up
// 0 - Camera Layer
// 1 - Vector Layer
// 2 - Bitmap Layer
// view manager
QTransform mCurrentView;

// playback manager
int mFps = 12;
bool mIsLoop = false;
bool mIsRangedPlayback = false;
int mMarkInFrame = 1;
int mMarkInFrame = 1;
int mMarkOutFrame = 10;

};
Expand Down

0 comments on commit 099a2b5

Please sign in to comment.