diff --git a/NEWS.md b/NEWS.md index edab1569..6bebb7b4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -47,6 +47,9 @@ Red Panda C++ Version 2.27 - fix: Failed to evaluate expressions while debugging, if the expression has spaces in it. - fix: When debugging, can't watch expressions that has spaces in it. - fix: Shortcuts in non-editor panels conficts with the editor. + - enhancement: Font list in the options / editor / font panel( by CyanoHao ). + - enhancement: Text are vertically center aligned in lines( by CyanoHao ). + - fix: In the debugger console, Auto-wrapped lines can't be correctly selected. Red Panda C++ Version 2.26 - enhancement: Code suggestion for embedded std::vectors. diff --git a/RedPandaIDE/widgets/qconsole.cpp b/RedPandaIDE/widgets/qconsole.cpp index 94f04991..6f5bdc9d 100644 --- a/RedPandaIDE/widgets/qconsole.cpp +++ b/RedPandaIDE/widgets/qconsole.cpp @@ -481,9 +481,7 @@ void QConsole::contentsLastRowsChanged(int rowCount) void QConsole::scrollTimerHandler() { - QPoint iMousePos; - - iMousePos = QCursor::pos(); + QPoint iMousePos = QCursor::pos(); iMousePos = mapFromGlobal(iMousePos); RowColumn mousePosRC = pixelsToNearestRowColumn(iMousePos.x(),iMousePos.y()); @@ -543,14 +541,15 @@ void QConsole::mouseMoveEvent(QMouseEvent *event) { QAbstractScrollArea::mouseMoveEvent(event); Qt::MouseButtons buttons = event->buttons(); - int X=event->pos().x(); - int Y=event->pos().y(); + int x=event->pos().x(); + int y=event->pos().y(); if ((buttons == Qt::LeftButton)) { // should we begin scrolling? - computeScrollY(Y); - RowColumn mousePosRC = pixelsToNearestRowColumn(X, Y); + computeScrollY(y); + RowColumn mousePosRC = pixelsToNearestRowColumn(x, y); LineChar mousePos = mContents.rowColumnToLineChar(mousePosRC); + //qDebug()<rect(); - if (Y < iScrollBounds.top()) - mScrollDeltaY = (Y - iScrollBounds.top()) / mRowHeight - 1; - else if (Y >= iScrollBounds.bottom()) - mScrollDeltaY = (Y - iScrollBounds.bottom()) / mRowHeight + 1; + if (y < iScrollBounds.top()) + mScrollDeltaY = (y - iScrollBounds.top()) / mRowHeight - 1; + else if (y >= iScrollBounds.bottom()) + mScrollDeltaY = (y - iScrollBounds.bottom()) / mRowHeight + 1; else mScrollDeltaY = 0; @@ -1159,13 +1158,18 @@ LineChar ConsoleLines::rowColumnToLineChar(int row, int column) int r=row - rows; QString fragment = line->fragments[r]; int columnsBefore = 0; + int charsBefore = 0; + for (int j=0;jfragments[j].length(); + } for (int j=0;jcharColumns(ch, columnsBefore); if (column>=columnsBefore && column