Skip to content

Commit

Permalink
Merge branch '2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
markandgo committed Mar 17, 2015
2 parents 18b168d + e1396bb commit 6b6b2e5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Tasty Text

Requires Love **0.9.1+**

Version: **2.1**
Version: **2.2**

This library is for printing pretty texts. The basic premise is to
use tags in strings to do special effects. Additionally, the library
Expand Down
20 changes: 10 additions & 10 deletions src/tastytext.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--[[
TastyText 2.1
TastyText 2.2
Copyright (c) 2014 Minh Ngo
This software is provided 'as-is', without any express or implied
Expand Down Expand Up @@ -73,14 +73,14 @@ if composite_number >= 009002 then
utf8sub = function(str,i,j)
j = j or -1

-- only set l if i or j is negative
local l = (i >= 0 and j >= 0) or utf8.len(str)
i = (i >= 0) and i or l + i + 1
j = (j >= 0) and j or l + j + 1

if i < 0 then i = 1 elseif i > l then i = l end
if j < 0 then j = 1 elseif j > l then j = l end

if i < 1 or j < 1 then
local l = utf8.len(str)
i = (i >= 0) and i or l + i + 1
j = (j >= 0) and j or l + j + 1
if i < 0 then i = 1 elseif i > l then i = l end
if j < 0 then j = 1 elseif j > l then j = l end
end

local byte_a = utf8.offset(str,i)
local byte_b = utf8.offset(str,j+1)-1
Expand Down Expand Up @@ -112,7 +112,7 @@ local escape_tag = string.format('%s([%s%s])',ESCAPE,START,END)
--TEXT CLASS
------------------------------------------------------------------------

local TastyText = {_VERSION = '2.1'}
local TastyText = {_VERSION = '2.2'}
TastyText.__index= TastyText

function TastyText.new(str,limit,default_font,tags,line_height)
Expand Down

0 comments on commit 6b6b2e5

Please sign in to comment.