Skip to content

Commit

Permalink
apps/radar/Lucid - working on rubber banding for zoom
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-dixon committed Jan 22, 2025
1 parent fe43ccf commit c666eb9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion codebase/apps/radar/src/Lucid/HorizWidget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ HorizWidget::HorizWidget(QWidget* parent,

// create the rubber band

_rubberBand = new QRubberBand(QRubberBand::Rectangle, this);
_rubberBand = new CustomRubberBand(QRubberBand::Rectangle, this);

// Allow the size_t type to be passed to slots

Expand Down
9 changes: 5 additions & 4 deletions codebase/apps/radar/src/Lucid/HorizWidget.hh
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ public:
protected:
void paintEvent(QPaintEvent *event) override {
QPainter painter(this);
painter.setCompositionMode(QPainter::RasterOp_SourceXorDestination);
// painter.setRenderHint(QPainter::Antialiasing);
// Draw border
QPen pen(Qt::black, 2); // Black border, 2 pixels wide
painter.setPen(pen);
painter.setPen(QColor(0xff, 0xff, 0xff));
// Transparent background
painter.setBrush(Qt::NoBrush);
// painter.setBrush(Qt::NoBrush);
// Adjust to stay within bounds
painter.drawRect(rect().adjusted(0, 0, -1, -1));
}
Expand Down Expand Up @@ -453,7 +453,8 @@ class DLL_EXPORT HorizWidget : public QWidget
* @brief Rubber band for zooming.
*/

QRubberBand *_rubberBand;
CustomRubberBand *_rubberBand;
QRect _zoomRect;

/**
* @brief The rubber band origin.
Expand Down

0 comments on commit c666eb9

Please sign in to comment.