Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made constructors more consistent #995

Merged
merged 1 commit into from
Aug 31, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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