twitter-archive / twui

A UI framework for Mac based on Core Animation
Other
2.74k stars 268 forks source link

TUITextField Not compatible with Chinese Input Method #97

Closed yarshure closed 12 years ago

yarshure commented 12 years ago

use Chinese Input Method I input "ai" mean "爱",but when type second character,it's became "a", not "ai" use English Input Method no problem.

mrjjwright commented 12 years ago

In general how usable are TUITextField and TUITextView? I notice Twitter for Mac doesn't appear to use them except in the search box.

yarshure commented 12 years ago

currently I'm on 10.8 , input ok both Twitter and My app. I will test on 10.7.3

avaidyam commented 12 years ago

Would you mind sharing a code snippet? My TUITextView doesn't scroll with the text and i'm sure that both field and view are not TUIScrollView subclasses.

yarshure commented 12 years ago

TUITextField, office Twitter Version 2.1.1,Mac OS X 10.7.3 in the search box, have this issue

avaidyam commented 12 years ago

I think yarshure means to say that the TUITextField in Twitter 2.1.1 has this issue in the search box, on OS X 10.7.3.

joshaber commented 12 years ago

FWIW, we have this fixed in our fork: https://github.com/github/twui/commit/6281d174216548960aadb9cf68e6538ac8948dcc

avaidyam commented 12 years ago

^ the GitHub/TwUI fork works perfectly! Thanks! I'd also like to know what the most current TwUI fork is? Looks like it's either joshaber's or github's.

yarshure commented 12 years ago

Thanks, but I found another issue in render TUITextField, first Chinese character lost left up corner example http://twitpic.com/8qtg57

avaidyam commented 12 years ago

The TUITextField clips the view to a rounded rectangle like in iOS. It's shown below: BOOL doMask = singleLine; if(doMask) { CGContextSaveGState(ctx); CGFloat radius = floor(rect.size.height / 2); CGContextClipToRoundRect(ctx, CGRectInset(textRect, 0.0f, -radius), radius); }

Just remove this block of code, and you won't lose portions of the characters.

joshaber commented 12 years ago

This is merged in as of #107.