LEFT | RIGHT |
(no file at all) | |
1 /* | 1 /* |
2 This file is part of LilyPond, the GNU music typesetter. | 2 This file is part of LilyPond, the GNU music typesetter. |
3 | 3 |
4 Copyright (C) 1998--2019 Jan Nieuwenhuizen <janneke@gnu.org> | 4 Copyright (C) 1998--2019 Jan Nieuwenhuizen <janneke@gnu.org> |
5 | 5 |
6 LilyPond is free software: you can redistribute it and/or modify | 6 LilyPond is free software: you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
8 the Free Software Foundation, either version 3 of the License, or | 8 the Free Software Foundation, either version 3 of the License, or |
9 (at your option) any later version. | 9 (at your option) any later version. |
10 | 10 |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 Bezier::translate (Offset o) | 333 Bezier::translate (Offset o) |
334 { | 334 { |
335 for (int i = 0; i < CONTROL_COUNT; i++) | 335 for (int i = 0; i < CONTROL_COUNT; i++) |
336 control_[i] += o; | 336 control_[i] += o; |
337 } | 337 } |
338 | 338 |
339 void | 339 void |
340 Bezier::assert_sanity () const | 340 Bezier::assert_sanity () const |
341 { | 341 { |
342 for (int i = 0; i < CONTROL_COUNT; i++) | 342 for (int i = 0; i < CONTROL_COUNT; i++) |
343 assert (!isnan (control_[i].length ()) | 343 assert (!std::isnan (control_[i].length ()) |
344 && !isinf (control_[i].length ())); | 344 && !std::isinf (control_[i].length ())); |
345 } | 345 } |
346 | 346 |
347 void | 347 void |
348 Bezier::reverse () | 348 Bezier::reverse () |
349 { | 349 { |
350 Bezier b2; | 350 Bezier b2; |
351 for (int i = 0; i < CONTROL_COUNT; i++) | 351 for (int i = 0; i < CONTROL_COUNT; i++) |
352 b2.control_[CONTROL_COUNT - i - 1] = control_[i]; | 352 b2.control_[CONTROL_COUNT - i - 1] = control_[i]; |
353 *this = b2; | 353 *this = b2; |
354 } | 354 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 else | 393 else |
394 subdivide (t_min, &bez1, &bez2); | 394 subdivide (t_min, &bez1, &bez2); |
395 if (t_max == 1.0) | 395 if (t_max == 1.0) |
396 return bez2; | 396 return bez2; |
397 else | 397 else |
398 { | 398 { |
399 bez2.subdivide ((t_max - t_min) / (1 - t_min), &bez3, &bez4); | 399 bez2.subdivide ((t_max - t_min) / (1 - t_min), &bez3, &bez4); |
400 return bez3; | 400 return bez3; |
401 } | 401 } |
402 } | 402 } |
LEFT | RIGHT |