* Draws the outline in the given colour, normalized using the given denorm, * making use of sub-pixel accurate information if available. */
| 995 | * making use of sub-pixel accurate information if available. |
| 996 | */ |
| 997 | void C_OUTLINE::plot_normed(const DENORM& denorm, ScrollView::Color colour, |
| 998 | ScrollView* window) const { |
| 999 | window->Pen(colour); |
| 1000 | if (stepcount == 0) { |
| 1001 | window->Rectangle(box.left(), box.top(), box.right(), box.bottom()); |
| 1002 | return; |
| 1003 | } |
| 1004 | const DENORM* root_denorm = denorm.RootDenorm(); |
| 1005 | ICOORD pos = start; // current position |
| 1006 | FCOORD f_pos = sub_pixel_pos_at_index(pos, 0); |
| 1007 | FCOORD pos_normed; |
| 1008 | denorm.NormTransform(root_denorm, f_pos, &pos_normed); |
| 1009 | window->SetCursor(IntCastRounded(pos_normed.x()), |
| 1010 | IntCastRounded(pos_normed.y())); |
| 1011 | for (int s = 0; s < stepcount; pos += step(s++)) { |
| 1012 | int edge_weight = edge_strength_at_index(s); |
| 1013 | if (edge_weight == 0) { |
| 1014 | // This point has conflicting gradient and step direction, so ignore it. |
| 1015 | continue; |
| 1016 | } |
| 1017 | FCOORD f_pos = sub_pixel_pos_at_index(pos, s); |
| 1018 | FCOORD pos_normed; |
| 1019 | denorm.NormTransform(root_denorm, f_pos, &pos_normed); |
| 1020 | window->DrawTo(IntCastRounded(pos_normed.x()), |
| 1021 | IntCastRounded(pos_normed.y())); |
| 1022 | } |
| 1023 | } |
| 1024 | #endif |
| 1025 | |
| 1026 | /** |
no test coverage detected