| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 257 |
| 258 m_shouldShrinkImage = !m_shouldShrinkImage; | 258 m_shouldShrinkImage = !m_shouldShrinkImage; |
| 259 | 259 |
| 260 if (m_shouldShrinkImage) | 260 if (m_shouldShrinkImage) |
| 261 windowSizeChanged(ScaleZoomedDocument); | 261 windowSizeChanged(ScaleZoomedDocument); |
| 262 else { | 262 else { |
| 263 restoreImageSize(ScaleZoomedDocument); | 263 restoreImageSize(ScaleZoomedDocument); |
| 264 | 264 |
| 265 updateLayout(); | 265 updateLayout(); |
| 266 | 266 |
| 267 float scale = this->scale(); | 267 double scale = this->scale(); |
| 268 | 268 |
| 269 int scrollX = static_cast<int>(x / scale - (float)frame()->view()->width
() / 2); | 269 double scrollX = x / scale - static_cast<double>(frame()->view()->width(
)) / 2; |
| 270 int scrollY = static_cast<int>(y / scale - (float)frame()->view()->heigh
t() / 2); | 270 double scrollY = y / scale - static_cast<double>(frame()->view()->height
()) / 2; |
| 271 | 271 |
| 272 frame()->view()->setScrollPosition(IntPoint(scrollX, scrollY)); | 272 frame()->view()->setScrollPosition(DoublePoint(scrollX, scrollY)); |
| 273 } | 273 } |
| 274 } | 274 } |
| 275 | 275 |
| 276 void ImageDocument::imageUpdated() | 276 void ImageDocument::imageUpdated() |
| 277 { | 277 { |
| 278 ASSERT(m_imageElement); | 278 ASSERT(m_imageElement); |
| 279 | 279 |
| 280 if (m_imageSizeIsKnown) | 280 if (m_imageSizeIsKnown) |
| 281 return; | 281 return; |
| 282 | 282 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 } | 396 } |
| 397 | 397 |
| 398 bool ImageEventListener::operator==(const EventListener& listener) | 398 bool ImageEventListener::operator==(const EventListener& listener) |
| 399 { | 399 { |
| 400 if (const ImageEventListener* imageEventListener = ImageEventListener::cast(
&listener)) | 400 if (const ImageEventListener* imageEventListener = ImageEventListener::cast(
&listener)) |
| 401 return m_doc == imageEventListener->m_doc; | 401 return m_doc == imageEventListener->m_doc; |
| 402 return false; | 402 return false; |
| 403 } | 403 } |
| 404 | 404 |
| 405 } | 405 } |
| OLD | NEW |