Mercurial > projects > dynamin
comparison dynamin/painting/windows_text_layout.d @ 102:604d20cac836
Add dynamin.core.array and put contains() there.
author | Jordan Miner <jminer7@gmail.com> |
---|---|
date | Tue, 15 May 2012 21:14:48 -0500 |
parents | 301e077da540 |
children | 73060bc3f004 |
comparison
equal
deleted
inserted
replaced
101:1690ebff00a0 | 102:604d20cac836 |
---|---|
34 public import tango.text.convert.Utf; | 34 public import tango.text.convert.Utf; |
35 public import tango.math.Math; | 35 public import tango.math.Math; |
36 | 36 |
37 //version = TextLayoutDebug; | 37 //version = TextLayoutDebug; |
38 | 38 |
39 // TODO: move to array.d | |
40 bool containsT(T)(T[] array, T item) { | |
41 foreach(T item2; array) { | |
42 if(item == item2) | |
43 return true; | |
44 } | |
45 return false; | |
46 } | |
47 template TextLayoutBackend() { | 39 template TextLayoutBackend() { |
48 uint charToWcharIndex(uint index) { | 40 uint charToWcharIndex(uint index) { |
49 uint wcharIndex = 0; | 41 uint wcharIndex = 0; |
50 foreach(wchar c; text[0..index]) | 42 foreach(wchar c; text[0..index]) |
51 wcharIndex++; | 43 wcharIndex++; |