File indexing completed on 2024-05-19 04:07:54
0001 /* 0002 SPDX-FileCopyrightText: 2015 Jakob Gruber <jakob.gruber@gmail.com> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "highlightitem.h" 0008 0009 #include "src/constants.h" 0010 0011 HighlightItem::HighlightItem(Renderer::Resource resource, int x, int y, QGraphicsItem *parent) : 0012 PixmapItem(resource, x, y, parent) 0013 { 0014 setEnabled(false); 0015 setZValue(ZVALUE_HIGHLIGHT); 0016 } 0017 0018 void HighlightItem::highlight(const QPoint &p) { 0019 bool highlighted = (p.x() == m_x || p.y() == m_y); 0020 setVisible(highlighted); 0021 }