| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2008, 2009 Google Inc. | 3 * Copyright (C) 2008, 2009 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 GraphicsContextStateSaver stateSaver(*context); | 115 GraphicsContextStateSaver stateSaver(*context); |
| 116 context->setShouldAntialias(false); | 116 context->setShouldAntialias(false); |
| 117 | 117 |
| 118 for (Vector<IntRect>::const_iterator i = tickmarks.begin(); i != tickmarks.e
nd(); ++i) { | 118 for (Vector<IntRect>::const_iterator i = tickmarks.begin(); i != tickmarks.e
nd(); ++i) { |
| 119 // Calculate how far down (in %) the tick-mark should appear. | 119 // Calculate how far down (in %) the tick-mark should appear. |
| 120 const float percent = static_cast<float>(i->y()) / scrollbar->totalSize(
); | 120 const float percent = static_cast<float>(i->y()) / scrollbar->totalSize(
); |
| 121 | 121 |
| 122 // Calculate how far down (in pixels) the tick-mark should appear. | 122 // Calculate how far down (in pixels) the tick-mark should appear. |
| 123 const int yPos = rect.y() + (rect.height() * percent); | 123 const int yPos = rect.y() + (rect.height() * percent); |
| 124 | 124 |
| 125 context->setFillColor(Color(0xCC, 0xAA, 0x00, 0xFF), ColorSpaceDeviceRGB
); | 125 context->setFillColor(Color(0xCC, 0xAA, 0x00, 0xFF)); |
| 126 FloatRect tickRect(rect.x(), yPos, rect.width(), 3); | 126 FloatRect tickRect(rect.x(), yPos, rect.width(), 3); |
| 127 context->fillRect(tickRect); | 127 context->fillRect(tickRect); |
| 128 | 128 |
| 129 context->setFillColor(Color(0xFF, 0xDD, 0x00, 0xFF), ColorSpaceDeviceRGB
); | 129 context->setFillColor(Color(0xFF, 0xDD, 0x00, 0xFF)); |
| 130 FloatRect tickStroke(rect.x(), yPos + 1, rect.width(), 1); | 130 FloatRect tickStroke(rect.x(), yPos + 1, rect.width(), 1); |
| 131 context->fillRect(tickStroke); | 131 context->fillRect(tickStroke); |
| 132 } | 132 } |
| 133 } | 133 } |
| 134 | 134 |
| 135 } // namespace WebCore | 135 } // namespace WebCore |
| OLD | NEW |