From 3d740424d572ed3f2e422926a11e883dbc20a96d Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Sun, 15 Mar 2015 02:07:59 -0700 Subject: [PATCH] Minor improvements, compile fix --- lime/app/Preloader.hx | 2 +- lime/text/Font.hx | 2 +- lime/text/TextLayout.hx | 12 ++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lime/app/Preloader.hx b/lime/app/Preloader.hx index b78f9746c..1a8418508 100644 --- a/lime/app/Preloader.hx +++ b/lime/app/Preloader.hx @@ -133,7 +133,7 @@ class Preloader #if flash extends Sprite #end { if (untyped (Browser.document).fonts && untyped (Browser.document).fonts.load) { - untyped (Browser.document).fonts.load ("1em '" + font + "'").then (function () { + untyped (Browser.document).fonts.load ("1em '" + font + "'").then (function (_) { loaded ++; update (loaded, total); diff --git a/lime/text/Font.hx b/lime/text/Font.hx index 2178632b9..272b67451 100644 --- a/lime/text/Font.hx +++ b/lime/text/Font.hx @@ -85,7 +85,7 @@ class Font { } - public function getGlyphs (characters:String):Array { + public function getGlyphs (characters:String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^`'\"/\\&*()[]{}<>|:;_-+=?,. "):Array { #if (cpp || neko || nodejs) return lime_font_get_glyph_indices (__handle, characters); diff --git a/lime/text/TextLayout.hx b/lime/text/TextLayout.hx index d855c77a0..0c4b80257 100644 --- a/lime/text/TextLayout.hx +++ b/lime/text/TextLayout.hx @@ -106,6 +106,8 @@ class TextLayout { @:noCompletion private function set_direction (value:TextDirection):TextDirection { + if (value == __direction) return value; + __direction = value; #if (cpp || neko || nodejs) @@ -121,6 +123,8 @@ class TextLayout { @:noCompletion private function set_font (value:Font):Font { + if (value == this.font) return value; + this.font = value; __position (); return value; @@ -152,6 +156,8 @@ class TextLayout { @:noCompletion private function set_language (value:String):String { + if (value == __language) return value; + __language = value; #if (cpp || neko || nodejs) @@ -174,6 +180,8 @@ class TextLayout { @:noCompletion private function set_script (value:TextScript):TextScript { + if (value == __script) return value; + __script = value; #if (cpp || neko || nodejs) @@ -189,6 +197,8 @@ class TextLayout { @:noCompletion private function set_size (value:Int):Int { + if (value == this.size) return value; + this.size = value; __position (); return value; @@ -198,6 +208,8 @@ class TextLayout { @:noCompletion private function set_text (value:String):String { + if (value == this.text) return value; + this.text = value; __position (); return value;