aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleLua.cpp
diff options
context:
space:
mode:
authorGravatar mike@reedtribe.org <mike@reedtribe.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-06-08 13:50:37 +0000
committerGravatar mike@reedtribe.org <mike@reedtribe.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-06-08 13:50:37 +0000
commit09efb177ed163cef118b192b796fc8afe2890408 (patch)
tree8f506b0cc7e12a9539b7f4f0b8aa84f8e5f03342 /samplecode/SampleLua.cpp
parentbdf59df6a17520b372ef4567bdca52ccef0c506b (diff)
Revert "add document and textAlign support to lua"
This reverts commit cdeacf8628757dc3464b26edd148c83bff02f43d. git-svn-id: http://skia.googlecode.com/svn/trunk@9481 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/SampleLua.cpp')
-rw-r--r--samplecode/SampleLua.cpp25
1 files changed, 5 insertions, 20 deletions
diff --git a/samplecode/SampleLua.cpp b/samplecode/SampleLua.cpp
index 104a427d7a..fb40087a12 100644
--- a/samplecode/SampleLua.cpp
+++ b/samplecode/SampleLua.cpp
@@ -50,23 +50,10 @@ static const char gCode[] = ""
" end "
" canvas:drawPath(path, path_paint);"
""
- " paint:setColor{a=1,r=0,g=0,b=1};"
- " local align = { 'left', 'center', 'right' };"
- " paint:setTextSize(30);"
- " for k, v in next, align do "
- " paint:setTextAlign(v);"
- " canvas:drawText('Hamburgefons', 320, 200 + 30*k, paint);"
- " end "
- "end "
- ""
- "function onStartup() "
- " local paint = Sk.newPaint();"
- " paint:setColor{a=1, r=1, g=0, b=0};"
- " local doc = Sk.newDocumentPDF('/skia/trunk/test.pdf');"
- " local canvas = doc:beginPage(72*8.5, 72*11);"
- " canvas:drawText('Hello Lua', 300, 300, paint);"
- " doc:close();"
- " doc = nil;"
+ " paint:setTypeface(Sk.newTypeface('Times', 1));"
+ " paint:setColor{a = 1, r=0, g=0, b = 1};"
+ " paint:setTextSize(70);"
+ " canvas:drawText('Hamburgefons', 50, 200, paint);"
"end "
""
"function onDrawContent(canvas) "
@@ -77,9 +64,7 @@ static const char gCode[] = ""
" canvas:drawOval(r, paint) "
" x = x + 1;"
" if x > 100 then x = 0 end;"
- "end "
- ""
- "onStartup();";
+ "end";
class LuaView : public SampleView {
public: