Skip to content

Commit

Permalink
Increased the size of the anchor label font in the LPS tab when indic…
Browse files Browse the repository at this point in the history
…ating that the tag is close to an anchor. Closes bitcraze#292
  • Loading branch information
krichardsson committed Mar 24, 2017
1 parent e9db0e1 commit 0cb1b68
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/cfclient/ui/tabs/locopositioning_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

from PyQt5 import uic
from PyQt5.QtCore import pyqtSignal, QTimer
from PyQt5.QtGui import QFont
from PyQt5.QtGui import QMessageBox

import cfclient
Expand Down Expand Up @@ -113,6 +114,9 @@ class PlotWrapper:
VICINITY_DISTANCE = 2.5
HIGHLIGHT_DISTANCE = 0.5

LABEL_SIZE = 15
LABEL_HIGHLIGHT_SIZE = 30

ANCHOR_SIZE = 10
HIGHLIGHT_SIZE = 20

Expand Down Expand Up @@ -159,6 +163,7 @@ def _find_missing_axis(self, axis1, axis2):
def _plot_anchor(self, x, y, anchor_id, distance, display_mode):
brush = PlotWrapper.ANCHOR_BRUSH
size = PlotWrapper.ANCHOR_SIZE
font_size = self.LABEL_SIZE
if display_mode is DisplayMode.identify_anchor:
if distance < PlotWrapper.VICINITY_DISTANCE:
brush = self._mix_brushes(
Expand All @@ -169,11 +174,14 @@ def _plot_anchor(self, x, y, anchor_id, distance, display_mode):
if distance < PlotWrapper.HIGHLIGHT_DISTANCE:
brush = PlotWrapper.HIGHLIGHT_ANCHOR_BRUSH
size = PlotWrapper.HIGHLIGHT_SIZE
font_size = self.LABEL_HIGHLIGHT_SIZE

self.widget.plot([x], [y], pen=None, symbolBrush=brush,
symbolSize=size)

text = pg.TextItem(text="{}".format(anchor_id))
font = QFont("Helvetica", font_size)
text.setFont(font)
self.widget.addItem(text)
text.setPos(x, y)

Expand Down

0 comments on commit 0cb1b68

Please sign in to comment.