Skip to content

Commit 7aae69a

Browse files
authored
Text overlap detection bug fix (#20)
* fix text overlap bug * bump version
1 parent 93f1f76 commit 7aae69a

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
matplotlib==3.7.2
22
numpy==1.25.2
3-
pandas==1.4.0
3+
pandas==2.0.3
44
pydantic==2.0.3
55
skyfield==1.46
66
adjustText==0.8
7-
cartopy==0.21.1
7+
cartopy==0.22.0
88
geopandas==0.13.2
99
pillow==10.0.0
1010
PyYAML==6.0.1

src/starplot/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Star charts and maps"""
22

3-
__version__ = "0.2.1"
3+
__version__ = "0.2.2"
44

55
from .base import StarPlot # noqa: F401
66
from .zenith import ZenithPlot # noqa: F401

src/starplot/base.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,10 @@ def _is_label_collision(self, extent) -> bool:
6161

6262
def _maybe_remove_label(self, label) -> None:
6363
extent = label.get_window_extent(renderer=self.fig.canvas.get_renderer())
64+
ax_extent = self.ax.get_window_extent()
6465

65-
if (
66-
self.ax.contains_point(extent.p0)
67-
and self.ax.contains_point(extent.p1)
68-
and not (self.hide_colliding_labels and self._is_label_collision(extent))
66+
if transforms.Bbox.intersection(ax_extent, extent) and not (
67+
self.hide_colliding_labels and self._is_label_collision(extent)
6968
):
7069
self.labels.append(label)
7170
self._labels_extents.append(extent)

0 commit comments

Comments
 (0)