Skip to content

Commit

Permalink
Fix access deprecated Chart.background.main_color
Browse files Browse the repository at this point in the history
  • Loading branch information
lcallarec committed Nov 24, 2020
1 parent 2a9db92 commit 5f8ddce
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
* Missing second point in line / line-area serie
* Last point in line / line-area rendered twice
* Left padding when auto padding is enabled and y axis has no unit
* Crash when accessing deprecated `Chart.background.main_color` property

* Tests can now be run deprecated stuff without warnings
* Tests can be ran deprecated stuff without warnings

# 1.9.0

Expand Down
2 changes: 1 addition & 1 deletion src/chart.vala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace LiveChart {
public class Chart : Gtk.DrawingArea {

public Grid grid { get; set; default = new Grid(); }
public Drawable background { get; set; default = new Background(); }
public Background background { get; set; default = new Background(); }
public Legend legend { get; set; default = new HorizontalLegend(); }
public Config config;
public Series series;
Expand Down
2 changes: 1 addition & 1 deletion src/static/static_chart.vala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace LiveChart.Static {
public class StaticChart : Gtk.DrawingArea {

public StaticGrid grid { get; set; default = new StaticGrid(); }
public Drawable background { get; set; default = new Background(); }
public Background background { get; set; default = new Background(); }
public Legend legend { get; set; default = new HorizontalLegend(); }
public Config config;
public StaticSeries series;
Expand Down
12 changes: 12 additions & 0 deletions tests/chart.vala
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,16 @@ private void register_chart() {
});
Gtk.main();
});

Test.add_func("/LiveChart/Chart/background#main_color_should_be_accessible_even_if_deprected", () => {
//given
var chart = new LiveChart.Chart();

//when
chart.background.main_color = {1, 1, 1, 1};

//then
//ok

});
}

0 comments on commit 5f8ddce

Please sign in to comment.