Skip to content

Commit

Permalink
fix dgsMemoGetTextBoundingBox
Browse files Browse the repository at this point in the history
  • Loading branch information
thisdp committed Mar 10, 2022
1 parent 7efd215 commit 9a3a102
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Core/memo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ function dgsMemoGetTextBoundingBox(memo,excludePadding)

local fontHeight = dxGetFontHeight(eleData.textSize[2],eleData.font or systemFont)
if eleData.wordWrap then
local textTable = eleData.wordWrapMapText
if eleData.rebuildMapTableNextFrame then dgsMemoRebuildWordWrapMapTable(memo) end
local textTable = eleData.wordWrapMapText
if excludePadding then
return eleData.absSize[1],#textTable*fontHeight
else
Expand Down Expand Up @@ -857,9 +857,7 @@ function handleDxMemoText(memo,text,noclear,noAffectCaret,index,line)
tab[#tab] = utf8Sub(tab[#tab],1,utf8Len(tab[#tab])-1)
local text = dgsGetText(memo)
local textLen = utf8Len(text)
if (textLen >= maxLength) then
return false
end
if textLen >= maxLength then return false end
local isWordWrap = eleData.wordWrap
local mapTable = eleData.wordWrapMapText or {}
local size = eleData.absSize
Expand Down

0 comments on commit 9a3a102

Please sign in to comment.