Baruch's fixes and draw fix for insettext

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1107 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Vigna 2000-10-12 13:53:52 +00:00
parent 325dccab09
commit 06f595812c
5 changed files with 27 additions and 17 deletions

View File

@ -1,5 +1,15 @@
2000-10-12 Baruch Even <baruch.even@writeme.com>
* src/graphics/GraphicsCacheItem_pimpl.C:
* src/graphics/Renderer.C:
* src/graphics/XPM_Renderer.C: Corrected resolution of conflicts.
It now compiles.
2000-10-12 Juergen Vigna <jug@sad.it>
* src/insets/insettext.C (draw): fixed drawing bug (specifically
visible when selecting).
* development/Code_rules/Rules: fixed some typos.
2000-10-09 Baruch Even <baruch.even@writeme.com>

View File

@ -41,9 +41,7 @@ GraphicsCacheItem_pimpl::GraphicsCacheItem_pimpl()
GraphicsCacheItem_pimpl::~GraphicsCacheItem_pimpl()
{
if (imageStatus_ == GraphicsCacheItem::Loaded) {
XFreePixmap(fl_get_display(), pixmap_);
}
delete pixmap_;
delete renderer;
}

View File

@ -87,5 +87,5 @@ string const & Renderer::getFilename() const
void Renderer::freePixmap()
{
if (pixmapLoaded_)
XFreePixmap(fl_get_display(), pixmap_);
XFreePixmap(fl_get_display(), pixmap_->getPixmap());
}

View File

@ -45,7 +45,7 @@ bool XPM_Renderer::renderImage()
//(BE 2000-08-05)
#warning This might be a dirty thing, but I dont know any other solution.
Screen * screen = ScreenOfDisplay(fl_get_display(), fl_screen); //DefaultScreen(display);
Screen * screen = ScreenOfDisplay(display, fl_screen);
int status = XpmReadFileToPixmap(
display,

View File

@ -315,32 +315,34 @@ void InsetText::draw(BufferView * bv, LyXFont const & f,
x += TEXT_TO_INSET_OFFSET;
int y = 0;
Row * row = TEXT(bv)->GetRowNearY(y);
int fa = row->ascent_of_text();
y += baseline - fa;
while (row != 0) {
if (((y+row->height()) > 0) && (y < pain.paperHeight()))
break;
int y_offset = baseline - row->ascent_of_text();
int ph = pain.paperHeight();
y += y_offset;
while ((row != 0) && ((y+row->height()) <= 0)) {
y += row->height();
row = row->next();
}
TEXT(bv)->first = y - top_baseline + fa;
y -= y_offset;
TEXT(bv)->first = y;
if (cleared || !locked || (need_update == FULL)) {
while (row != 0) {
if (((y+row->height()) > 0) && (y < pain.paperHeight()))
TEXT(bv)->GetVisibleRow(bv, int(y), int(x), row, y, cleared);
int first = y;
y = 0;
while ((row != 0) && (y < ph)) {
TEXT(bv)->GetVisibleRow(bv, y+first+y_offset, int(x), row,
y+first, cleared);
y += row->height();
row = row->next();
}
} else if (need_update == SELECTION) {
bv->screen()->ToggleToggle(TEXT(bv), int(y), int(x));
bv->screen()->ToggleToggle(TEXT(bv), y+y_offset, int(x));
} else {
locked = false;
if (need_update == CURSOR) {
bv->screen()->ToggleSelection(TEXT(bv), true, int(y), int(x));
bv->screen()->ToggleSelection(TEXT(bv), true, y+y_offset, int(x));
TEXT(bv)->ClearSelection();
TEXT(bv)->sel_cursor = TEXT(bv)->cursor;
}
bv->screen()->Update(TEXT(bv), int(y), int(x));
bv->screen()->Update(TEXT(bv), y, int(x));
locked = true;
}
TEXT(bv)->refresh_y = 0;