Give Wide() inset proper clickable area

* status.14x: updated

	* src/insets/insettext.[Ch]: added covers() method



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_4_X@15415 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Martin Vermeer 2006-10-20 16:46:03 +00:00
parent d0b141506f
commit 4854791af8
3 changed files with 15 additions and 0 deletions

View File

@ -17,6 +17,7 @@
#include "bufferparams.h"
#include "BufferView.h"
#include "CutAndPaste.h"
#include "coordcache.h"
#include "cursor.h"
#include "debug.h"
#include "dispatchresult.h"
@ -224,6 +225,16 @@ void InsetText::drawSelection(PainterInfo & pi, int x, int y) const
}
bool InsetText::covers(int x, int y) const
{
return theCoords.getInsets().has(this)
&& x >= xo()
&& x <= xo() + width() + (Wide() ? text_.maxwidth_ : 0)
&& y >= yo() - ascent()
&& y <= yo() + descent();
}
string const InsetText::editMessage() const
{
return _("Opened Text Inset");

View File

@ -52,6 +52,8 @@ public:
void draw(PainterInfo & pi, int x, int y) const;
/// draw inset selection
void drawSelection(PainterInfo & pi, int x, int y) const;
/// do we cover screen position x/y?
virtual bool covers(int x, int y) const;
///
std::string const editMessage() const;
///

View File

@ -60,6 +60,8 @@ What's new
- Don't show starred sections in Document->Numbering & TOC (bug 2910)
- Make clicking in a "Wide" inset always enter that inset.
* Build/installation: