| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 FloatRect fr = frame->selection()->bounds(); | 86 FloatRect fr = frame->selection()->bounds(); |
| 87 IntRect ir(static_cast<int>(fr.x()), static_cast<int>(fr.y()), | 87 IntRect ir(static_cast<int>(fr.x()), static_cast<int>(fr.y()), |
| 88 static_cast<int>(fr.width()), static_cast<int>(fr.height())); | 88 static_cast<int>(fr.width()), static_cast<int>(fr.height())); |
| 89 HBITMAP image = imageFromRect(frame, ir); | 89 HBITMAP image = imageFromRect(frame, ir); |
| 90 frame->view()->setPaintBehavior(PaintBehaviorNormal); | 90 frame->view()->setPaintBehavior(PaintBehaviorNormal); |
| 91 return image; | 91 return image; |
| 92 } | 92 } |
| 93 | 93 |
| 94 DragImageRef Frame::nodeImage(Node* node) | 94 DragImageRef Frame::nodeImage(Node* node) |
| 95 { | 95 { |
| 96 document()->updateLayout(); |
| 97 |
| 96 RenderObject* renderer = node->renderer(); | 98 RenderObject* renderer = node->renderer(); |
| 97 if (!renderer) | 99 if (!renderer) |
| 98 return 0; | 100 return 0; |
| 99 | 101 |
| 100 LayoutRect topLevelRect; | 102 LayoutRect topLevelRect; |
| 101 IntRect paintingRect = pixelSnappedIntRect(renderer->paintingRootRect(topLev
elRect)); | 103 IntRect paintingRect = pixelSnappedIntRect(renderer->paintingRootRect(topLev
elRect)); |
| 102 | 104 |
| 103 document()->updateLayout(); | |
| 104 | |
| 105 m_view->setNodeToDraw(node); // invoke special sub-tree drawing mode | 105 m_view->setNodeToDraw(node); // invoke special sub-tree drawing mode |
| 106 HBITMAP result = imageFromRect(this, paintingRect); | 106 HBITMAP result = imageFromRect(this, paintingRect); |
| 107 m_view->setNodeToDraw(0); | 107 m_view->setNodeToDraw(0); |
| 108 | 108 |
| 109 return result; | 109 return result; |
| 110 } | 110 } |
| 111 | 111 |
| 112 } // namespace WebCore | 112 } // namespace WebCore |
| OLD | NEW |