deps(specctra-core): use geo-types instead of geo

This commit is contained in:
Alain Emilia Anna Zscheile 2024-12-11 14:57:42 +01:00
parent e76f740563
commit 355faa59c7
4 changed files with 12 additions and 7 deletions

View File

@ -11,6 +11,11 @@ serde_json = "1.0"
spade = "2.12"
thiserror = "2.0"
[workspace.dependencies.geo-types]
version = "0.7"
default-features = false
features = ["serde"]
[workspace.dependencies.geo]
version = "0.29"
default-features = false

View File

@ -5,7 +5,7 @@ edition = "2021"
[dependencies]
bimap.workspace = true
geo.workspace = true
geo-types.workspace = true
serde.workspace = true
specctra_derive.path = "../specctra_derive"
thiserror.workspace = true

View File

@ -1,5 +1,5 @@
use core::ops::Sub;
use geo::geometry::Point;
use geo_types::geometry::Point;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
@ -20,7 +20,7 @@ impl Circle {
///
/// `phi` is the angle given in radians starting at `(r, 0)`.
pub fn position_at_angle(&self, phi: f64) -> Point {
geo::point! {
geo_types::point! {
x: self.pos.0.x + self.r * phi.cos(),
y: self.pos.0.y + self.r * phi.sin()
}

View File

@ -392,17 +392,17 @@ pub struct Point {
pub y: f64,
}
impl From<geo::Point> for Point {
impl From<geo_types::Point> for Point {
#[inline(always)]
fn from(z: geo::Point) -> Self {
fn from(z: geo_types::Point) -> Self {
Point { x: z.0.x, y: z.0.y }
}
}
impl From<Point> for geo::Point {
impl From<Point> for geo_types::Point {
#[inline(always)]
fn from(z: Point) -> Self {
geo::point! {
geo_types::point! {
x: z.x,
y: z.y
}