# Buggy code
def _set_highlight(self, force=False):
    """Render highlights of shapes including boundaries, vertices,
    interaction boxes, and the drag selection box when appropriate

    Parameters
    ----------
    force : bool
        Bool that forces a redraw to occur when `True`
    """
    # Check if any point ids have changed since last call
    if (
        self.selected_data == self._selected_data_stored
        and self._value == self._value_stored
        and np.all(self._drag_box == self._drag_box_stored)
    ) and not force:
        return
    self._selected_data_stored = copy(self.selected_data)
    self._value_stored = copy(self._value)
    self._drag_box_stored = copy(self._drag_box)

    if self._mode == Mode.SELECT and (
        self._value is not None or len(self._selected_view) > 0
    ):
        if len(self._selected_view) > 0:
            index = copy(self._selected_view)
            if self._value is not None:
                hover_point = list(self._indices_view).index(self._value)
                if hover_point in index:
                    pass
                else:
                    index.append(hover_point)
            index.sort()
        else:
            hover_point = list(self._indices_view).index(self._value)
            index = [hover_point]

        self._highlight_index = index
    else:
        self._highlight_index = []

    pos = self._selected_box
    if pos is None and not self._is_selecting:
        pos = np.zeros((0, 2))
    elif self._is_selecting:
        pos = create_box(self._drag_box)
        pos = pos[list(range(4)) + [0]]
    else:
        pos = pos[list(range(4)) + [0]]

    self._highlight_box = pos
    self.events.highlight()


# Traceback (ValueError)
WARNING: Traceback (most recent call last):
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 173, in <lambda>
lambda state=self: self.change_ndisplay(state)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 178, in change_ndisplay
self.viewer.dims.ndisplay = 3
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/components/dims.py", line 296, in ndisplay
self.events.ndisplay()
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/utils/event.py", line 508, in __call__
self._invoke_callback(cb, event)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/utils/event.py", line 529, in _invoke_callback
cb_event=(cb, event),
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/utils/event.py", line 523, in _invoke_callback
cb(event)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/components/viewer_model.py", line 88, in <lambda>
self.dims.events.ndisplay.connect(lambda e: self._update_layers())
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/components/viewer_model.py", line 1037, in _update_layers
layer.dims.ndisplay = self.dims.ndisplay
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/components/dims.py", line 296, in ndisplay
self.events.ndisplay()
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/utils/event.py", line 508, in __call__
self._invoke_callback(cb, event)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/utils/event.py", line 529, in _invoke_callback
cb_event=(cb, event),
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/utils/event.py", line 523, in _invoke_callback
cb(event)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/layers/base/base.py", line 180, in <lambda>
self.dims.events.ndisplay.connect(lambda e: self._update_dims())
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/layers/base/base.py", line 383, in _update_dims
self.refresh()
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/layers/base/base.py", line 600, in refresh
self._set_view_slice()
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/layers/points/points.py", line 654, in _set_view_slice
self._selected_box = self.interaction_box(self._selected_view)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/layers/points/points.py", line 480, in interaction_box
data = points_to_squares(data, size)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/layers/points/points.py", line 972, in points_to_squares
points + np.sqrt(2) / 2 * np.array([sizes, sizes]).T,
ValueError: operands could not be broadcast together with shapes (1,3) (1,2)
WARNING:vispy:Traceback (most recent call last):
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 173, in <lambda>
lambda state=self: self.change_ndisplay(state)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/_qt/qt_viewer_buttons.py", line 178, in change_ndisplay
self.viewer.dims.ndisplay = 3
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/components/dims.py", line 296, in ndisplay
self.events.ndisplay()
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/utils/event.py", line 508, in __call__
self._invoke_callback(cb, event)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/utils/event.py", line 529, in _invoke_callback
cb_event=(cb, event),
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/utils/event.py", line 523, in _invoke_callback
cb(event)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/components/viewer_model.py", line 88, in <lambda>
self.dims.events.ndisplay.connect(lambda e: self._update_layers())
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/components/viewer_model.py", line 1037, in _update_layers
layer.dims.ndisplay = self.dims.ndisplay
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/components/dims.py", line 296, in ndisplay
self.events.ndisplay()
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/utils/event.py", line 508, in __call__
self._invoke_callback(cb, event)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/utils/event.py", line 529, in _invoke_callback
cb_event=(cb, event),
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/utils/event.py", line 523, in _invoke_callback
cb(event)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/layers/base/base.py", line 180, in <lambda>
self.dims.events.ndisplay.connect(lambda e: self._update_dims())
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/layers/base/base.py", line 383, in _update_dims
self.refresh()
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/layers/base/base.py", line 600, in refresh
self._set_view_slice()
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/layers/points/points.py", line 654, in _set_view_slice
self._selected_box = self.interaction_box(self._selected_view)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/layers/points/points.py", line 480, in interaction_box
data = points_to_squares(data, size)
File "/home/hagai/.conda/envs/ncd/lib/python3.7/site-packages/napari/layers/points/points.py", line 972, in points_to_squares
points + np.sqrt(2) / 2 * np.array([sizes, sizes]).T,
ValueError: operands could not be broadcast together with shapes (1,3) (1,2)

# Fixed code
def _set_highlight(self, force=False):
    """Render highlights of shapes including boundaries, vertices,
    interaction boxes, and the drag selection box when appropriate.
    Highlighting only occurs in Mode.SELECT.

    Parameters
    ----------
    force : bool
        Bool that forces a redraw to occur when `True`
    """
    # if self._mode == Mode.SELECT:
    # Check if any point ids have changed since last call
    if self.selected:
        if (
            self.selected_data == self._selected_data_stored
            and self._value == self._value_stored
            and np.all(self._drag_box == self._drag_box_stored)
        ) and not force:
            return
        self._selected_data_stored = copy(self.selected_data)
        self._value_stored = copy(self._value)
        self._drag_box_stored = copy(self._drag_box)

        if self._value is not None or len(self._selected_view) > 0:
            if len(self._selected_view) > 0:
                index = copy(self._selected_view)
                # highlight the hovered point if not in adding mode
                if self._value is not None and self._mode != Mode.ADD:
                    hover_point = list(self._indices_view).index(self._value)
                    if hover_point in index:
                        pass
                    else:
                        index.append(hover_point)
                index.sort()
            else:
                # don't highlight hovered points in add mode
                if self._mode != Mode.ADD:
                    hover_point = list(self._indices_view).index(self._value)
                    index = [hover_point]
                else:
                    index = []

            self._highlight_index = index
        else:
            self._highlight_index = []

        # only display dragging selection box in 2D
        if self.dims.ndisplay == 2 and self._is_selecting:
            pos = create_box(self._drag_box)
            pos = pos[list(range(4)) + [0]]
        else:
            pos = None

        self._highlight_box = pos
        self.events.highlight()
    else:
        self._highlight_box = None
        self._highlight_index = []
        self.events.highlight()