Skip to content
This repository was archived by the owner on Apr 26, 2019. It is now read-only.

Fixed settings and more ... #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# xcode noise
*.mode1v3
# Xcode
.DS_Store
*/build/*
*.pbxuser
*.perspective
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
*.pyc
*~.nib/
build/*

# Textmate - if you build your xcode projects with it
*.tm_build_errors

# old skool
.svn

# osx noise
.DS_Store
!default.perspectivev3
xcuserdata
profile
*.moved-aside
DerivedData
.idea/
*.hmap
Binary file added [email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 12 additions & 1 deletion MTLabel.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
147737E11391B7C200BCB59A /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 147737DF1391B7C200BCB59A /* MainWindow.xib */; };
147737E41391B7C200BCB59A /* MTLabelViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 147737E31391B7C200BCB59A /* MTLabelViewController.m */; };
147737E71391B7C200BCB59A /* MTLabelViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 147737E51391B7C200BCB59A /* MTLabelViewController.xib */; };
147737EF1391B7D400BCB59A /* MTLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 147737EE1391B7D400BCB59A /* MTLabel.m */; };
147737EF1391B7D400BCB59A /* MTLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 147737EE1391B7D400BCB59A /* MTLabel.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; };
147737F11391B86600BCB59A /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 147737F01391B86600BCB59A /* CoreText.framework */; };
FA614AF41727F8FC00724B20 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = FA614AF31727F8FC00724B20 /* [email protected] */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -38,6 +39,7 @@
147737ED1391B7D400BCB59A /* MTLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTLabel.h; sourceTree = "<group>"; };
147737EE1391B7D400BCB59A /* MTLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTLabel.m; sourceTree = "<group>"; };
147737F01391B86600BCB59A /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; };
FA614AF31727F8FC00724B20 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -58,6 +60,7 @@
147737BE1391B7C100BCB59A = {
isa = PBXGroup;
children = (
FA614AF31727F8FC00724B20 /* [email protected] */,
147737D31391B7C100BCB59A /* MTLabel */,
147737CC1391B7C100BCB59A /* Frameworks */,
147737CA1391B7C100BCB59A /* Products */,
Expand Down Expand Up @@ -135,6 +138,9 @@
/* Begin PBXProject section */
147737C01391B7C100BCB59A /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0460;
};
buildConfigurationList = 147737C31391B7C100BCB59A /* Build configuration list for PBXProject "MTLabel" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
Expand All @@ -160,6 +166,7 @@
147737D81391B7C200BCB59A /* InfoPlist.strings in Resources */,
147737E11391B7C200BCB59A /* MainWindow.xib in Resources */,
147737E71391B7C200BCB59A /* MTLabelViewController.xib in Resources */,
FA614AF41727F8FC00724B20 /* [email protected] in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -247,7 +254,9 @@
GCC_DYNAMIC_NO_PIC = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "MTLabel/MTLabel-Prefix.pch";
GCC_VERSION = "";
INFOPLIST_FILE = "MTLabel/MTLabel-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -260,7 +269,9 @@
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "MTLabel/MTLabel-Prefix.pch";
GCC_VERSION = "";
INFOPLIST_FILE = "MTLabel/MTLabel-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
PRODUCT_NAME = "$(TARGET_NAME)";
VALIDATE_PRODUCT = YES;
WRAPPER_EXTENSION = app;
Expand Down
8 changes: 5 additions & 3 deletions MTLabel/MTLabel.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
// limitations under the License.

#import "MTLabel.h"
#import "HAWLabel.h"
#import "UILabel+HAWAdditions.h"
#import <CoreText/CoreText.h>
#import <QuartzCore/QuartzCore.h>

Expand Down Expand Up @@ -83,7 +81,11 @@ - (void)setText:(NSString *)text {
- (void)setFont:(UIFont *)font {
if (font != _font) {
_font = font;

if (self._lineHeight == [UIFont systemFontOfSize:DEFAULT_FONT_SIZE].lineHeight) {
self._lineHeight = _font.lineHeight;

}
[self setNeedsDisplay];
}
}
Expand Down Expand Up @@ -502,7 +504,7 @@ - (CGFloat)labelTopMargin
return self.font.ascender - self.font.capHeight;
}

- (CGFloat)positionBelowLabel:(HAWLabel *)label offset:(CGSize)offset
- (CGFloat)positionBelowLabel:(MTLabel *)label offset:(CGSize)offset
{
CGRect fromRect = label.frame;
CGRect toRect = self.bounds;
Expand Down