| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 else { | 288 else { |
| 289 restoreImageSize(ScaleZoomedDocument); | 289 restoreImageSize(ScaleZoomedDocument); |
| 290 | 290 |
| 291 updateLayout(); | 291 updateLayout(); |
| 292 | 292 |
| 293 double scale = this->scale(); | 293 double scale = this->scale(); |
| 294 | 294 |
| 295 double scrollX = x / scale - static_cast<double>(frame()->view()->width(
)) / 2; | 295 double scrollX = x / scale - static_cast<double>(frame()->view()->width(
)) / 2; |
| 296 double scrollY = y / scale - static_cast<double>(frame()->view()->height
()) / 2; | 296 double scrollY = y / scale - static_cast<double>(frame()->view()->height
()) / 2; |
| 297 | 297 |
| 298 frame()->view()->setScrollPosition(DoublePoint(scrollX, scrollY)); | 298 frame()->view()->setScrollPosition(DoublePoint(scrollX, scrollY), Progra
mmaticScroll); |
| 299 } | 299 } |
| 300 } | 300 } |
| 301 | 301 |
| 302 void ImageDocument::imageUpdated() | 302 void ImageDocument::imageUpdated() |
| 303 { | 303 { |
| 304 ASSERT(m_imageElement); | 304 ASSERT(m_imageElement); |
| 305 | 305 |
| 306 if (m_imageSizeIsKnown) | 306 if (m_imageSizeIsKnown) |
| 307 return; | 307 return; |
| 308 | 308 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 } | 443 } |
| 444 | 444 |
| 445 bool ImageEventListener::operator==(const EventListener& listener) | 445 bool ImageEventListener::operator==(const EventListener& listener) |
| 446 { | 446 { |
| 447 if (const ImageEventListener* imageEventListener = ImageEventListener::cast(
&listener)) | 447 if (const ImageEventListener* imageEventListener = ImageEventListener::cast(
&listener)) |
| 448 return m_doc == imageEventListener->m_doc; | 448 return m_doc == imageEventListener->m_doc; |
| 449 return false; | 449 return false; |
| 450 } | 450 } |
| 451 | 451 |
| 452 } | 452 } |
| OLD | NEW |