* insettext.[Ch]
(InsetText::covers): added to allow the click-sensitive area to grow
with the Wide() condition.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15384
a592a061-630c-0410-9148-
cb99ea01b6c8
#include "buffer.h"
#include "bufferparams.h"
#include "BufferView.h"
+#include "coordcache.h"
#include "CutAndPaste.h"
#include "cursor.h"
#include "debug.h"
}
+bool InsetText::covers(BufferView & bv, int x, int y) const
+{
+ return bv.coordCache().getInsets().has(this)
+ && x >= xo(bv)
+ && x <= xo(bv) + width() + (Wide() ? text_.maxwidth_ : 0)
+ && y >= yo(bv) - ascent()
+ && y <= yo(bv) + descent();
+}
+
+
docstring const InsetText::editMessage() const
{
return _("Opened Text Inset");
void draw(PainterInfo & pi, int x, int y) const;
/// draw inset selection
void drawSelection(PainterInfo & pi, int x, int y) const;
+ /// are we inside the area covered by the inset?
+ virtual bool covers(BufferView & bv, int x, int y) const;
///
virtual lyx::docstring const editMessage() const;
///