 }
 
 float applyAlignOption(float rawAngle, float delta) {
-
-  if (option == -1) {
-    // useful for backward compatibility, all texts remains horizontal
-    return 0.0;
-  } else if (option == 0) {
-    // use the raw angle as calculated by atan
-    return rawAngle;
-  } else if (option == 1) {
-    // option 1: use free angle, but flip to align with axis
-    return rawAngle + delta;
-  } else if (option == 2) {
-    // option 2: horizontal or vertical
-    return look_horizontal_or_vertical(rawAngle, hv_ratio);
-  }
-
-  // option 3-n: round to n directions
-  return look_round_n_directions(rawAngle, option);
+  return
+    (option >  2) ? look_round_n_directions(rawAngle + delta, option) :       // option 3-n: round to n directions
+    (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical
+    (option == 1) ? rawAngle + delta :       // use free angle, and flip to align with one direction of the axis
+    (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards
+    (option ==-1) ? 0.0 :                    // useful for backward compatibility, all texts remains horizontal
+                    rawAngle;                // otherwise return back raw input angle
 }
 
 bool enableAlign = (alignDir.x != 0.0) || (alignDir.y != 0.0) || (alignDir.z != 0.0);

int option = int(floor(alignOpt.x + 0.001));
float hv_ratio =       alignOpt.y;

float positive_angle(float a) {
  return (a < 0.0) ?
    a + TWO_PI :
    a;
}

float look_upwards(float a) {


  float beta = angle; // i.e. user defined attributes for each tick

  float axisAngle;
  float clipAngle;
  float flip;
  
  if (enableAlign) {
    axisAngle = (isAxisTitle) ? HALF_PI :
                      computeViewAngle(dataPosition, dataPosition + axis);
    clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);

    axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;
    clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;

    flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),
                      vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;

    beta += applyAlignOption(clipAngle, flip * PI);
