mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
(Rob Lahaye): fix clipping when using the basic image loader.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3998 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
02962ba61a
commit
36c21f7712
@ -1,3 +1,6 @@
|
||||
2002-04-16 Rob Lahaye <lahaye@users.sourceforge.net>
|
||||
* GraphicsImageXPM.C: fix clipping for boundingbox y-coordinates
|
||||
|
||||
2002-04-08 Angus Leeming <a.leeming@ic.ac.uk>
|
||||
|
||||
* GraphicsCacheItem.C (findTargetFormat): fix bug waiting to bite:
|
||||
|
@ -244,11 +244,17 @@ void GImageXPM::clip(GParams const & params)
|
||||
return;
|
||||
|
||||
dimension * new_data = image_.initialisedData(new_width, new_height);
|
||||
dimension const * old_data = image_.data();
|
||||
|
||||
dimension * it = new_data;
|
||||
dimension const * start_row = old_data;
|
||||
for (size_t row = params.bb.yb; row < params.bb.yt; ++row) {
|
||||
|
||||
// The image is stored in memory from upper-left to lower-right,
|
||||
// so we loop from yt to yb.
|
||||
dimension const * old_data = image_.data();
|
||||
dimension const * start_row = old_data +
|
||||
image_.width() * (image_.height() - params.bb.yt);
|
||||
|
||||
// the Bounding Box dimensions are never less than zero, so we can use
|
||||
// "unsigned int row" here
|
||||
for (dimension row = params.bb.yb; row < params.bb.yt; ++row) {
|
||||
dimension const * begin = start_row + params.bb.xl;
|
||||
dimension const * end = start_row + params.bb.xr;
|
||||
it = std::copy(begin, end, it);
|
||||
|
Loading…
Reference in New Issue
Block a user