use defines.
This commit is contained in:
@@ -20,6 +20,15 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* definitions
|
||||||
|
* ------------------------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define AQDG_WIDGET_XAXIS_TICK_MIN_X 10
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
/* ------------------------------------------------------------------------------------------------
|
||||||
* forward declarations
|
* forward declarations
|
||||||
* ------------------------------------------------------------------------------------------------
|
* ------------------------------------------------------------------------------------------------
|
||||||
@@ -131,7 +140,7 @@ void _drawTicks(AQDG_OBJECT *o, AQDG_DRAW_CONTEXT *dc, int absY)
|
|||||||
minValue=AQDG_AxisWidget_GetMinValue(o);
|
minValue=AQDG_AxisWidget_GetMinValue(o);
|
||||||
maxValue=AQDG_AxisWidget_GetMaxValue(o);
|
maxValue=AQDG_AxisWidget_GetMaxValue(o);
|
||||||
pen=AQDG_DrawableWidget_GetForegroundPenId(o);
|
pen=AQDG_DrawableWidget_GetForegroundPenId(o);
|
||||||
showLevel1=(_screenDistBetweenLevelTicks(tickList, 1, contentSize, minValue, maxValue)>15)?1:0;
|
showLevel1=(_screenDistBetweenLevelTicks(tickList, 1, contentSize, minValue, maxValue)>AQDG_WIDGET_XAXIS_TICK_MIN_X)?1:0;
|
||||||
|
|
||||||
tick=AQDG_Graph_Tick_List_First(tickList);
|
tick=AQDG_Graph_Tick_List_First(tickList);
|
||||||
while(tick) {
|
while(tick) {
|
||||||
@@ -162,9 +171,7 @@ int _screenDistBetweenLevelTicks(const AQDG_GRAPH_TICK_LIST *tickList, int lvl,
|
|||||||
int pts;
|
int pts;
|
||||||
|
|
||||||
v=AQDG_Graph_Tick_List_DistanceBetweenTicks(tickList, lvl);
|
v=AQDG_Graph_Tick_List_DistanceBetweenTicks(tickList, lvl);
|
||||||
DBG_ERROR(NULL, "Value diff: %.2f", v);
|
|
||||||
pts=v*(contentSize/(maxValue-minValue));
|
pts=v*(contentSize/(maxValue-minValue));
|
||||||
DBG_ERROR(NULL, "Point diff: %d", pts);
|
|
||||||
return pts;
|
return pts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,15 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* definitions
|
||||||
|
* ------------------------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define AQDG_WIDGET_YAXIS_TICK_MIN_Y 20
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
/* ------------------------------------------------------------------------------------------------
|
||||||
* forward declarations
|
* forward declarations
|
||||||
* ------------------------------------------------------------------------------------------------
|
* ------------------------------------------------------------------------------------------------
|
||||||
@@ -158,7 +167,7 @@ void _drawTicks(AQDG_OBJECT *o, AQDG_DRAW_CONTEXT *dc, int absX)
|
|||||||
minValue=AQDG_AxisWidget_GetMinValue(o);
|
minValue=AQDG_AxisWidget_GetMinValue(o);
|
||||||
maxValue=AQDG_AxisWidget_GetMaxValue(o);
|
maxValue=AQDG_AxisWidget_GetMaxValue(o);
|
||||||
pen=AQDG_DrawableWidget_GetForegroundPenId(o);
|
pen=AQDG_DrawableWidget_GetForegroundPenId(o);
|
||||||
showLevel1=(_screenDistBetweenLevelTicks(tickList, 1, contentSize, minValue, maxValue)>15)?1:0;
|
showLevel1=(_screenDistBetweenLevelTicks(tickList, 1, contentSize, minValue, maxValue)>AQDG_WIDGET_YAXIS_TICK_MIN_Y)?1:0;
|
||||||
|
|
||||||
tick=AQDG_Graph_Tick_List_First(tickList);
|
tick=AQDG_Graph_Tick_List_First(tickList);
|
||||||
while(tick) {
|
while(tick) {
|
||||||
@@ -189,9 +198,7 @@ int _screenDistBetweenLevelTicks(const AQDG_GRAPH_TICK_LIST *tickList, int lvl,
|
|||||||
int pts;
|
int pts;
|
||||||
|
|
||||||
v=AQDG_Graph_Tick_List_DistanceBetweenTicks(tickList, lvl);
|
v=AQDG_Graph_Tick_List_DistanceBetweenTicks(tickList, lvl);
|
||||||
DBG_ERROR(NULL, "Value diff: %.2f", v);
|
|
||||||
pts=(v*(contentSize/(maxValue-minValue)));
|
pts=(v*(contentSize/(maxValue-minValue)));
|
||||||
DBG_ERROR(NULL, "Point diff: %d", pts);
|
|
||||||
return pts;
|
return pts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user