"curveRulerSnapValue"

With the trend attribute "curveRulerSnapValue" you can activate the snapping mode (on/off) for the Y-axis for the horizontal ruler while moving it up/down.

Synopsis

shape.curveRulerSnapValue(string curve, float value);

setValue(string shape,"curveRulerSnapValue",string curve, float value);

getValue(string shape,"curveRulerSnapValue",string curve, float value);

shape.curveRulerSnapValueX(string curve, float value);

setValue(string shape,"curveRulerSnapValueX",string curve, float value);

getValue(string shape,"curveRulerSnapValueX",string curve, float value);

Parameter

Parameter Description
curve The trend curve for which the snap mode is activated.
value

The snap value.

Default: 0.0 = no snapping

Einschränkung: The snap value can only be used for linear trends. It cannot be used for logarithmic trends.

Description

The attribute activates the snapping mode (on/off) for the Y-axis for the horizontal ruler while moving it up/down.

When the snapping is activated and the mouse button is released while moving ruler up/down, the ruler is automatically moved to the nearest Y-axis-value of the snap step value.

If the snapping is activated and the snapping step is set, for example, to 1 and the ruler is released at the value 20.30, the ruler is automatically moved to 20.00. If the snapping step is set to, for example, 10 and the ruler is released at the value 37.30, the ruler is automatically moved to 40.00.

The snapping mode is only applied for existing horizontal rulers. The snapping mode is not used when a ruler is initialized.

The Attribute curveRulerSnapValueX cannot be used.

Note that you have to set the config entry trendEnableCurveRulers = 1 in the UI section of the config file in order to use this attribute.

Example

This example uses the snap value of the text field when a button is clicked and sets this value for the TREND2. Furthermore, the text "Steps off" or "Steps on" (TRUE/FALSE) is shown.

main()
{
  float fStep;
  if (bSnap==FALSE)
 {
   bSnap=TRUE;
   fStep=(float)txt_step.text;
   TREND2.curveRulerSnapValue("#1_1",fStep);
   bt_steps.text="Steps off";
 }
 else
 {
   bSnap=FALSE;
   TREND2.curveRulerSnapValue("#1_1",0);
   bt_steps.text="Steps on";
 }
}
Abbildung 1. Snapping was activated for a Trend

Assignment

Trend