Skip to content

Commit

Permalink
Merge pull request PistonDevelopers#995 from bvssvni/master
Browse files Browse the repository at this point in the history
Made constructors more consistent
  • Loading branch information
bvssvni committed Aug 31, 2015
2 parents 3154d5a + f55311a commit 6c4b66c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

name = "piston2d-graphics"
version = "0.7.1"
version = "0.8.0"
authors = [
"bvssvni <[email protected]>",
"Coeuvre <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,5 @@ pub fn text<C, G>(
C: character::CharacterCache,
G: Graphics<Texture = <C as character::CharacterCache>::Texture>
{
Text::colored(color, font_size).draw(text, cache, default_draw_state(), transform, g)
}
Text::new_color(color, font_size).draw(text, cache, default_draw_state(), transform, g)
}
4 changes: 2 additions & 2 deletions src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl Text {
}

/// Creates a new colored text
pub fn colored(
pub fn new_color(
color: Color,
font_size: FontSize
) -> Text {
Expand All @@ -47,7 +47,7 @@ impl Text {
C: CharacterCache,
G: Graphics<Texture = <C as CharacterCache>::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() {
Expand Down

0 comments on commit 6c4b66c

Please sign in to comment.