# HG changeset patch # User Rik # Date 1380660608 25200 # Node ID 4f1dd8a980df91f6fa2c259c1458ef5c5cb79625 # Parent 76a6d7de4cbcc107b74b5828b48f3bf77fff4f6d Clip OpenGL text rotations to range [0,360]. * libinterp/corefcn/txt-eng-ft.cc(rotation_to_mode): Add or subtract increments of 360 degrees to put rotation into range [0,360]. diff --git a/libinterp/corefcn/txt-eng-ft.cc b/libinterp/corefcn/txt-eng-ft.cc --- a/libinterp/corefcn/txt-eng-ft.cc +++ b/libinterp/corefcn/txt-eng-ft.cc @@ -949,6 +949,12 @@ int ft_render::rotation_to_mode (double rotation) const { + // Clip rotation to range [0, 360] + while (rotation < 0) + rotation += 360.0; + while (rotation > 360.0) + rotation -= 360.0; + if (rotation == 0.0) return ROTATION_0; else if (rotation == 90.0) @@ -967,7 +973,6 @@ int _halign, int valign, double rotation, const caseless_str& interpreter) { - // FIXME: clip "rotation" between 0 and 360 int rot_mode = rotation_to_mode (rotation); halign = _halign;