In progress... show_text() -> Text.vala
This commit is contained in:
parent
d67e2c2691
commit
6f5e5773d2
|
@ -201,17 +201,7 @@ namespace CairoChart {
|
|||
public double title_indent = 4;
|
||||
|
||||
public virtual void show_text(Text text) {
|
||||
context.select_font_face(text.style.family,
|
||||
text.style.slant,
|
||||
text.style.weight);
|
||||
context.set_font_size(text.style.size);
|
||||
if (text.style.orientation == Font.Orientation.VERTICAL) {
|
||||
context.rotate(- Math.PI / 2.0);
|
||||
context.show_text(text.text);
|
||||
context.rotate(Math.PI / 2.0);
|
||||
} else {
|
||||
context.show_text(text.text);
|
||||
}
|
||||
text.show(context);
|
||||
}
|
||||
|
||||
protected virtual void draw_chart_title () {
|
||||
|
|
|
@ -52,6 +52,20 @@ namespace CairoChart {
|
|||
return sz;
|
||||
}
|
||||
|
||||
public void show (Cairo.Context context) {
|
||||
context.select_font_face(style.family,
|
||||
style.slant,
|
||||
style.weight);
|
||||
context.set_font_size(style.size);
|
||||
if (style.orientation == Font.Orientation.VERTICAL) {
|
||||
context.rotate(- Math.PI / 2.0);
|
||||
context.show_text(text);
|
||||
context.rotate(Math.PI / 2.0);
|
||||
} else {
|
||||
context.show_text(text);
|
||||
}
|
||||
}
|
||||
|
||||
public Text (string text = "",
|
||||
Font.Style style = Font.Style(),
|
||||
Color color = Color()) {
|
||||
|
|
Loading…
Reference in New Issue