Fix text cropping when using ellipsization in wxGrid
A text is cropped for cells with ellipsization enabled when width of the cell nearly equal to width of the text because wxGrid::DrawTextRectangle function variant with the parameter of type wxArrayString adds the offset before actually drawing the text using dc.DrawText or dc.DrawRotatedText.
This commit is contained in:
@@ -6831,13 +6831,16 @@ void wxGrid::DrawTextRectangle(wxDC& dc,
|
||||
{
|
||||
attr.GetNonDefaultAlignment(&hAlign, &vAlign);
|
||||
|
||||
// The text will be displaced in final wxGrid::DrawTextRectangle function.
|
||||
const int textMargin = 2;
|
||||
|
||||
// This does nothing if there is no need to ellipsize.
|
||||
const wxString& ellipsizedText = wxControl::Ellipsize
|
||||
(
|
||||
text,
|
||||
dc,
|
||||
attr.GetFitMode().GetEllipsizeMode(),
|
||||
rect.GetWidth(),
|
||||
rect.GetWidth() - textMargin,
|
||||
wxELLIPSIZE_FLAGS_NONE
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user