Skip to content

Commit

Permalink
Remove obsolete code
Browse files Browse the repository at this point in the history
Actually the first check would always return true because the blitRect and mTilledBuffer rect are in different coordinate spaces.
  • Loading branch information
MrStevns committed Dec 3, 2023
1 parent 8baa511 commit b4e4faa
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
12 changes: 2 additions & 10 deletions core_lib/src/canvaspainter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,16 +300,8 @@ void CanvasPainter::paintCurrentBitmapFrame(QPainter& painter, const QRect& blit

if (isCurrentLayer && isDrawing)
{
// Certain tools require being painted continuously, for example, the Polyline tool.
// The tiled buffer does not update the area outside which it paints,
// so in that case, in order to see the previously laid-down polyline stroke,
// the surrounding area must be drawn again before
// applying the new tiled output on top

if (!blitRect.contains(mTiledBuffer->bounds()) || mOptions.bIgnoreCanvasBuffer) {
currentBitmapPainter.setCompositionMode(QPainter::CompositionMode_SourceOver);
currentBitmapPainter.drawImage(paintedImage->topLeft(), *paintedImage->image());
}
currentBitmapPainter.setCompositionMode(QPainter::CompositionMode_SourceOver);
currentBitmapPainter.drawImage(paintedImage->topLeft(), *paintedImage->image());

const auto tiles = mTiledBuffer->tiles();
for (const Tile* tile : tiles) {
Expand Down
3 changes: 0 additions & 3 deletions core_lib/src/canvaspainter.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ struct CanvasPainterOptions
bool bThinLines = false;
bool bOutlines = false;

/// When using a tool that can't rely on canvas buffer,
/// for example Polyline because we're continously clearing the surface
bool bIgnoreCanvasBuffer = false;
LayerVisibility eLayerVisibility = LayerVisibility::RELATED;
float fLayerVisibilityThreshold = 0.f;
float scaling = 1.0f;
Expand Down
1 change: 0 additions & 1 deletion core_lib/src/interface/scribblearea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,6 @@ void ScribbleArea::prepCanvas(int frame)
o.fLayerVisibilityThreshold = mPrefs->getFloat(SETTING::LAYER_VISIBILITY_THRESHOLD);
o.scaling = mEditor->view()->scaling();
o.cmBufferBlendMode = mEditor->tools()->currentTool()->type() == ToolType::ERASER ? QPainter::CompositionMode_DestinationOut : QPainter::CompositionMode_SourceOver;
o.bIgnoreCanvasBuffer = currentTool()->type() == POLYLINE;

OnionSkinPainterOptions onionSkinOptions;
onionSkinOptions.enabledWhilePlaying = mPrefs->getInt(SETTING::ONION_WHILE_PLAYBACK);
Expand Down

0 comments on commit b4e4faa

Please sign in to comment.