Merge pull request #1218 from manongjohn/current_level_on_top

Current Drawing on Top
This commit is contained in:
manongjohn 2023-09-26 01:16:47 -04:00 committed by GitHub
commit 4d7b061fa7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 141 additions and 4 deletions

View file

@ -116,6 +116,8 @@ public:
static bool m_isLightTableEnabled;
bool m_currentDrawingOnTop;
public:
Player();

View file

@ -141,6 +141,7 @@ struct DVAPI VisitArgs {
TRasterImageP m_lineupImage = 0;
Stage::Player m_liveViewPlayer;
Stage::Player m_lineupPlayer;
bool m_currentDrawingOnTop;
public:
VisitArgs()
@ -157,7 +158,8 @@ public:
, m_isGuidedDrawingEnabled(0)
, m_guidedFrontStroke(-1)
, m_guidedBackStroke(-1)
, m_rasterizePli(false) {}
, m_rasterizePli(false)
, m_currentDrawingOnTop(false) {}
};
//=============================================================================

View file

@ -166,6 +166,8 @@ private:
TXsheetColumnChangeObserver *m_observer;
bool m_currentDrawingOnTop;
DECLARE_CLASS_CODE
public:
@ -599,6 +601,9 @@ in TXsheetImp.
bool isFrameTagged(int frame) const;
void toggleTaggedFrame(int frame);
bool isCurrentDrawingOnTop() { return m_currentDrawingOnTop; }
void setCurrentDrawingOnTop(bool onTop) { m_currentDrawingOnTop = onTop; }
protected:
bool checkCircularReferences(TXsheet *childCandidate);

View file

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="16px"
height="16px"
version="1.1"
xml:space="preserve"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"
id="svg20"
sodipodi:docname="current_on_top.svg"
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs24" /><sodipodi:namedview
id="namedview22"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="true"
inkscape:snap-grids="false"
inkscape:zoom="44.9375"
inkscape:cx="8"
inkscape:cy="7.9888734"
inkscape:window-width="1920"
inkscape:window-height="1141"
inkscape:window-x="-7"
inkscape:window-y="-7"
inkscape:window-maximized="1"
inkscape:current-layer="g18"><inkscape:grid
type="xygrid"
id="grid841" /></sodipodi:namedview>
<g
transform="matrix(1,0,0,1,-170,-210)"
id="g18">
<g
id="new_vector_level"
transform="matrix(1,0,0,1,60,-20)">
<g
id="bg"
transform="matrix(0.110345,0,0,0.121212,93.7793,211.091)">
<rect
x="147"
y="156"
width="145"
height="132"
style="fill:rgb(135,135,135);fill-opacity:0;"
id="rect2" />
</g>
<g
id="g11">
<g
transform="matrix(1,0,0,1,1,0)"
id="g7">
<path
d="M120,231.5L123.5,235L120,235L120,231.5Z"
id="path5" />
</g>
<path
d="m 125,235 c 0,-0.265 -0.105,-0.52 -0.293,-0.707 l -3,-3 C 121.52,231.105 121.265,231 121,231 h -9 c -0.552,0 -1,0.448 -1,1 v 5 c 0,0.552 0.448,1 1,1 h 12 c 0.552,0 1,-0.448 1,-1 z m -1,0 -3,-3 h -9 v 5 h 12 z"
id="path9"
sodipodi:nodetypes="sccsssssssscccccc" />
</g>
<g
transform="matrix(1,0,0,1,108,227)"
id="g15">
</g>
</g>
<rect
style="fill:#000000;stroke:#000000;stroke-width:1.24066;stroke-linecap:round;stroke-dashoffset:0.9"
id="rect3568"
width="12.880068"
height="0.75934029"
x="171.49828"
y="220.12033" /><rect
style="clip-rule:evenodd;fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.24067;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:2;stroke-dashoffset:0.9"
id="rect3568-5"
width="12.880322"
height="0.7593298"
x="171.51547"
y="223.62033" /></g>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View file

@ -2334,6 +2334,8 @@ void MainWindow::defineActions() {
RasterizePliToggleAction = 0;
createToggle(MI_ToggleLightTable, QT_TR_NOOP("Light Table"), "", false,
MenuViewCommandType, "light_table");
createToggle(MI_CurrentDrawingOnTop, QT_TR_NOOP("Current Drawing On Top"), "", false,
MenuViewCommandType, "current_on_top");
// Menu - Panes

View file

@ -619,6 +619,8 @@ void TopBar::loadMenubar() {
addMenuItem(viewMenu, MI_NoShift);
addMenuItem(viewMenu, MI_ResetShift);
viewMenu->addSeparator();
addMenuItem(viewMenu, MI_CurrentDrawingOnTop);
viewMenu->addSeparator();
addMenuItem(viewMenu, MI_VectorGuidedDrawing);
viewMenu->addSeparator();
addMenuItem(viewMenu, MI_RasterizePli);

View file

@ -513,4 +513,5 @@
#define MI_ToggleLightTable "MI_ToggleLightTable"
#define MI_CurrentDrawingOnTop "MI_CurrentDrawingOnTop"
#endif

View file

@ -785,6 +785,24 @@ public:
}
} TLightTableToggleCommand;
class TCurrentDrawingOnTopCommand final : public MenuItemHandler {
public:
TCurrentDrawingOnTopCommand() : MenuItemHandler(MI_CurrentDrawingOnTop) {}
void execute() override {
CommandManager *cm = CommandManager::instance();
QAction *action = cm->getAction(MI_CurrentDrawingOnTop);
TApp::instance()->getCurrentXsheet()->getXsheet()->setCurrentDrawingOnTop(
action->isChecked());
TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
}
bool isChecked(CommandId id) const {
QAction *action = CommandManager::instance()->getAction(id);
return action != 0 && action->isChecked();
}
} TCurrentDrawingOnTopCommand;
//=============================================================================
// SceneViewer
//-----------------------------------------------------------------------------
@ -2200,6 +2218,8 @@ void SceneViewer::drawScene() {
args.m_isGuidedDrawingEnabled = useGuidedDrawing;
args.m_guidedFrontStroke = guidedFrontStroke;
args.m_guidedBackStroke = guidedBackStroke;
args.m_currentDrawingOnTop =
app->getCurrentXsheet()->getXsheet()->isCurrentDrawingOnTop();
// args.m_currentFrameId = app->getCurrentFrame()->getFid();
@ -2317,6 +2337,8 @@ void SceneViewer::drawScene() {
args.m_isGuidedDrawingEnabled = useGuidedDrawing;
args.m_guidedFrontStroke = guidedFrontStroke;
args.m_guidedBackStroke = guidedBackStroke;
args.m_currentDrawingOnTop =
app->getCurrentXsheet()->getXsheet()->isCurrentDrawingOnTop();
if (m_stopMotion->m_alwaysUseLiveViewImages &&
m_stopMotion->m_liveViewStatus > 0 &&

View file

@ -469,6 +469,8 @@
<file>icons/dark/actions/16/tape_end_to_line.svg</file>
<file>icons/dark/actions/16/tape_line_to_line.svg</file>
<file>icons/dark/actions/16/current_on_top.svg</file>
<file>icons/dark/actions/16/shift_and_trace.svg</file>
<file>icons/dark/actions/16/shift_and_trace_edit.svg</file>
<file>icons/dark/actions/16/shift_and_trace_no_shift.svg</file>

View file

@ -1413,6 +1413,8 @@ void RowArea::contextMenuEvent(QContextMenuEvent *event) {
menu->addAction(cmdManager->getAction(MI_EditShift));
menu->addAction(cmdManager->getAction(MI_NoShift));
menu->addAction(cmdManager->getAction(MI_ResetShift));
menu->addSeparator();
menu->addAction(cmdManager->getAction(MI_CurrentDrawingOnTop));
// Tags
menu->addSeparator();

View file

@ -219,6 +219,8 @@ public:
Stage::Player m_liveViewPlayer;
Stage::Player m_lineupPlayer;
bool m_currentDrawingOnTop;
public:
StageBuilder();
virtual ~StageBuilder();
@ -285,7 +287,8 @@ StageBuilder::StageBuilder()
, m_fade(0)
, m_shiftTraceGhostId(NO_GHOST)
, m_currentXsheetLevel(0)
, m_xsheetLevel(0) {
, m_xsheetLevel(0)
, m_currentDrawingOnTop(false) {
m_placementStack.push_back(ZPlacement());
}
@ -483,6 +486,10 @@ void StageBuilder::addCell(PlayerSet &players, ToonzScene *scene, TXsheet *xsh,
}
}
player.m_currentDrawingOnTop = m_currentDrawingOnTop;
if (m_currentDrawingOnTop && player.m_isCurrentColumn)
player.m_bingoOrder = 10;
players.push_back(player);
} else if (TXshChildLevel *cl = xl->getChildLevel()) {
int childRow = cell.m_frameId.getNumber() - 1;
@ -828,6 +835,7 @@ void StageBuilder::addSimpleLevelFrame(PlayerSet &players,
player.m_isEditingLevel = true;
player.m_ancestorColumnIndex = -1;
player.m_dpiAff = getDpiAffine(level, fid);
player.m_currentDrawingOnTop = m_currentDrawingOnTop;
}
//-----------------------------------------------------------------------------
@ -922,6 +930,7 @@ void Stage::visit(Visitor &visitor, const VisitArgs &args) {
sb.m_isGuidedDrawingEnabled = args.m_isGuidedDrawingEnabled;
sb.m_guidedFrontStroke = args.m_guidedFrontStroke;
sb.m_guidedBackStroke = args.m_guidedBackStroke;
sb.m_currentDrawingOnTop = args.m_currentDrawingOnTop;
if (args.m_liveViewImage) {
sb.m_liveViewImage = args.m_liveViewImage;
sb.m_liveViewPlayer = args.m_liveViewPlayer;

View file

@ -45,7 +45,8 @@ Stage::Player::Player()
, m_frame(0)
, m_isPlaying(false)
, m_opacity(255)
, m_bingoOrder(0) {}
, m_bingoOrder(0)
, m_currentDrawingOnTop(false) {}
//-----------------------------------------------------------------------------

View file

@ -199,7 +199,8 @@ TXsheet::TXsheet()
, m_notes(new TXshNoteSet())
, m_cameraColumnIndex(0)
, m_observer(nullptr)
, m_navigationTags(new NavigationTags()) {
, m_navigationTags(new NavigationTags())
, m_currentDrawingOnTop(false) {
// extern TSyntax::Grammar *createXsheetGrammar(TXsheet*);
m_soundProperties = new TXsheet::SoundProperties();
m_imp->m_handleManager = new XshHandleManager(this);