Skip to content

Commit 634835b

Browse files
dengzhongyuan365-devlzwind
authored andcommitted
fix(shot): prevent abnormal shape drawing when AI assistant button is clicked
AI assistant is not a drawing tool, but ShapesWidget treated it as one. When m_currentType was set to "aiassistant", dragging in the capture area would enter the shape recording logic (m_isRecording = true) and fall through to the "non-text" branch in mouseReleaseEvent, creating an unexpected shape on the canvas. Skip the drawing logic in mousePressEvent when m_currentType is "aiassistant" so that existing shapes are preserved and no new shapes are created. bug: https://pms.uniontech.com/bug-view-356039.html
1 parent b7c8c5f commit 634835b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/widgets/shapeswidget.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,6 +1341,11 @@ void ShapesWidget::mousePressEvent(QMouseEvent *e)
13411341
m_pressedPoint = e->pos();
13421342
m_isPressed = true;
13431343
if (!clickedOnShapes(m_pressedPoint)) {
1344+
// AI助手不是绘图工具,不进入绘制逻辑
1345+
if (m_currentType == "aiassistant") {
1346+
DFrame::mousePressEvent(e);
1347+
return;
1348+
}
13441349

13451350
m_isRecording = true;
13461351
//qDebug() << "no one shape be clicked!" << m_selectedIndex << m_shapes.length();

0 commit comments

Comments
 (0)