From f55311a797fb90a010ba5144885dd5a4360c3819 Mon Sep 17 00:00:00 2001 From: Sven Nilsen Date: Mon, 31 Aug 2015 12:18:09 +0200 Subject: [PATCH] Made constructors more consistent Closes https://github.com/PistonDevelopers/graphics/issues/993 --- Cargo.toml | 2 +- src/context.rs | 2 +- src/image.rs | 2 +- src/lib.rs | 4 ++-- src/text.rs | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7051b97..b6a5c44 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "piston2d-graphics" -version = "0.7.1" +version = "0.8.0" authors = [ "bvssvni ", "Coeuvre ", diff --git a/src/context.rs b/src/context.rs index e50fa3b..338f802 100644 --- a/src/context.rs +++ b/src/context.rs @@ -70,7 +70,7 @@ impl Context { /// and x axis pointing to the right /// and y axis pointing down. #[inline(always)] - pub fn abs(w: Scalar, h: Scalar) -> Context { + pub fn new_abs(w: Scalar, h: Scalar) -> Context { let mat = abs_transform(w, h); Context { view: mat, diff --git a/src/image.rs b/src/image.rs index f4c78ad..f30950f 100644 --- a/src/image.rs +++ b/src/image.rs @@ -75,7 +75,7 @@ impl Image { } /// Creates a new colored image - pub fn new_colored(color: Color) -> Image { + pub fn new_color(color: Color) -> Image { Image { color: Some(color), source_rectangle: None, diff --git a/src/lib.rs b/src/lib.rs index 936d8d0..2616658 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -169,5 +169,5 @@ pub fn text( C: character::CharacterCache, G: Graphics::Texture> { - Text::colored(color, font_size).draw(text, cache, default_draw_state(), transform, g) -} \ No newline at end of file + Text::new_color(color, font_size).draw(text, cache, default_draw_state(), transform, g) +} diff --git a/src/text.rs b/src/text.rs index 76ab2e2..e50099a 100644 --- a/src/text.rs +++ b/src/text.rs @@ -24,7 +24,7 @@ impl Text { } /// Creates a new colored text - pub fn colored( + pub fn new_color( color: Color, font_size: FontSize ) -> Text { @@ -47,7 +47,7 @@ impl Text { C: CharacterCache, G: Graphics::Texture> { - let image = Image::new_colored(self.color); + let image = Image::new_color(self.color); let mut x = 0.0; let mut y = 0.0; for ch in text.chars() {