Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Material
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
Material
Commits
b90ee8ac
Commit
b90ee8ac
authored
Jun 25, 2018
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup for colors and layer shape setting
parent
d89a6935
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
8 deletions
+14
-8
Material.xcodeproj/xcshareddata/xcschemes/Material.xcscheme
+1
-1
Sources/iOS/Material+CALayer.swift
+7
-5
Sources/iOS/Material+UIColor.swift
+6
-2
No files found.
Material.xcodeproj/xcshareddata/xcschemes/Material.xcscheme
View file @
b90ee8ac
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion =
"09
3
0"
LastUpgradeVersion =
"09
4
0"
version =
"1.3"
>
<BuildAction
parallelizeBuildables =
"YES"
...
...
Sources/iOS/Material+CALayer.swift
View file @
b90ee8ac
...
...
@@ -259,20 +259,22 @@ extension CALayer {
return
}
if
0
==
bounds
.
width
{
bounds
.
size
.
width
=
bounds
.
height
if
0
==
frame
.
width
{
frame
.
size
.
width
=
frame
.
height
}
if
0
==
bounds
.
height
{
bounds
.
size
.
height
=
bounds
.
width
if
0
==
frame
.
height
{
frame
.
size
.
height
=
frame
.
width
}
guard
.
circle
==
shapePreset
else
{
masksToBounds
=
false
cornerRadius
=
0
return
}
cornerRadius
=
bounds
.
size
.
width
/
2
masksToBounds
=
true
cornerRadius
=
frame
.
size
.
width
/
2
}
/// Sets the shadow path.
...
...
Sources/iOS/Material+UIColor.swift
View file @
b90ee8ac
...
...
@@ -44,7 +44,11 @@ public extension UIColor {
let
r
=
argb
>>
16
let
g
=
argb
>>
8
let
b
=
argb
>>
0
func
f
(
_
v
:
UInt32
)
->
CGFloat
{
return
CGFloat
(
v
&
0xff
)
/
255
}
func
f
(
_
v
:
UInt32
)
->
CGFloat
{
return
CGFloat
(
v
&
0xff
)
/
255
}
self
.
init
(
red
:
f
(
r
),
green
:
f
(
g
),
blue
:
f
(
b
),
alpha
:
f
(
a
))
}
...
...
@@ -55,6 +59,6 @@ public extension UIColor {
- Parameter rgb: An unsigned 32 bit integer. E.g 0xAA44CC.
*/
convenience
init
(
rgb
:
UInt32
)
{
self
.
init
(
argb
:
(
UInt32
(
0xff000000
)
)
|
rgb
)
self
.
init
(
argb
:
(
0xff000000
as
UInt32
)
|
rgb
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment