diff options
author | Andrew Hannam <andrewh@inmarket.com.au> | 2012-12-13 22:33:05 +1000 |
---|---|---|
committer | Andrew Hannam <andrewh@inmarket.com.au> | 2012-12-13 22:33:05 +1000 |
commit | 311c0e71684462269afb15264b7134a0f16064bc (patch) | |
tree | 3cdf67549051b5c739c138c3d289addb8636147d /src | |
parent | d503f3a4ac81198d3e9fb41179a20382d76cfcb8 (diff) | |
download | uGFX-311c0e71684462269afb15264b7134a0f16064bc.tar.gz uGFX-311c0e71684462269afb15264b7134a0f16064bc.tar.bz2 uGFX-311c0e71684462269afb15264b7134a0f16064bc.zip |
Add grids to graph demo and update graph arrows
Add grid lines to graph demo.
Update graph arrows to allow seperate control of positive and negative
axis arrowheads.
Diffstat (limited to 'src')
-rw-r--r-- | src/gwin/graph.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gwin/graph.c b/src/gwin/graph.c index 581001ad..cc457d7d 100644 --- a/src/gwin/graph.c +++ b/src/gwin/graph.c @@ -299,11 +299,13 @@ void gwinGraphDrawAxis(GHandle gh) { // x axis
lineto(gg, xmin, 0, xmax, 0, &gg->style.xaxis);
- if ((gg->style.flags & GWIN_GRAPH_STYLE_XAXIS_ARROWS)) {
+ if ((gg->style.flags & GWIN_GRAPH_STYLE_XAXIS_NEGATIVE_ARROWS)) {
if (xmin > 0 || xmin < -(GGRAPH_ARROW_SIZE+1)) {
lineto(gg, xmin, 0, xmin+GGRAPH_ARROW_SIZE, GGRAPH_ARROW_SIZE, &gg->style.xaxis);
lineto(gg, xmin, 0, xmin+GGRAPH_ARROW_SIZE, -GGRAPH_ARROW_SIZE, &gg->style.xaxis);
}
+ }
+ if ((gg->style.flags & GWIN_GRAPH_STYLE_XAXIS_POSITIVE_ARROWS)) {
if (xmax < 0 || xmax > (GGRAPH_ARROW_SIZE+1)) {
lineto(gg, xmax, 0, xmax-GGRAPH_ARROW_SIZE, GGRAPH_ARROW_SIZE, &gg->style.xaxis);
lineto(gg, xmax, 0, xmax-GGRAPH_ARROW_SIZE, -GGRAPH_ARROW_SIZE, &gg->style.xaxis);
@@ -312,11 +314,13 @@ void gwinGraphDrawAxis(GHandle gh) { // y axis
lineto(gg, 0, ymin, 0, ymax, &gg->style.yaxis);
- if ((gg->style.flags & GWIN_GRAPH_STYLE_YAXIS_ARROWS)) {
+ if ((gg->style.flags & GWIN_GRAPH_STYLE_YAXIS_NEGATIVE_ARROWS)) {
if (ymin > 0 || ymin < -(GGRAPH_ARROW_SIZE+1)) {
lineto(gg, 0, ymin, GGRAPH_ARROW_SIZE, ymin+GGRAPH_ARROW_SIZE, &gg->style.yaxis);
lineto(gg, 0, ymin, -GGRAPH_ARROW_SIZE, ymin+GGRAPH_ARROW_SIZE, &gg->style.yaxis);
}
+ }
+ if ((gg->style.flags & GWIN_GRAPH_STYLE_YAXIS_POSITIVE_ARROWS)) {
if (ymax < 0 || ymax > (GGRAPH_ARROW_SIZE+1)) {
lineto(gg, 0, ymax, GGRAPH_ARROW_SIZE, ymax-GGRAPH_ARROW_SIZE, &gg->style.yaxis);
lineto(gg, 0, ymax, -GGRAPH_ARROW_SIZE, ymax-GGRAPH_ARROW_SIZE, &gg->style.yaxis);
|