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
35c09def
Commit
35c09def
authored
Aug 07, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed shape management when changing width and height
parent
be05fff0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
14 deletions
+22
-14
Sources/iOS/Material+UIView.swift
+22
-14
No files found.
Sources/iOS/Material+UIView.swift
View file @
35c09def
...
...
@@ -122,56 +122,64 @@ extension UIView {
}
}
/// A property that accesses the
layer.
frame.origin.x property.
/// A property that accesses the frame.origin.x property.
@IBInspectable
public
var
x
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
x
return
frame
.
origin
.
x
}
set
(
value
)
{
layer
.
frame
.
origin
.
x
=
value
frame
.
origin
.
x
=
value
layoutShadowPath
()
}
}
/// A property that accesses the
layer.
frame.origin.y property.
/// A property that accesses the frame.origin.y property.
@IBInspectable
public
var
y
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
y
return
frame
.
origin
.
y
}
set
(
value
)
{
layer
.
frame
.
origin
.
y
=
value
frame
.
origin
.
y
=
value
layoutShadowPath
()
}
}
/// A property that accesses the
layer.
frame.size.width property.
/// A property that accesses the frame.size.width property.
@IBInspectable
public
var
width
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
width
return
frame
.
size
.
width
}
set
(
value
)
{
layer
.
frame
.
size
.
width
=
value
frame
.
size
.
width
=
value
if
.
none
!=
shapePreset
{
frame
.
size
.
height
=
value
layoutShape
()
}
layoutShadowPath
()
}
}
/// A property that accesses the
layer.
frame.size.height property.
/// A property that accesses the frame.size.height property.
@IBInspectable
public
var
height
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
height
return
frame
.
size
.
height
}
set
(
value
)
{
layer
.
frame
.
size
.
height
=
value
frame
.
size
.
height
=
value
if
.
none
!=
shapePreset
{
frame
.
size
.
width
=
value
layoutShape
()
}
layoutShadowPath
()
}
}
...
...
@@ -394,9 +402,9 @@ extension UIView {
public
func
layoutShape
()
{
if
.
none
!=
shapePreset
{
if
width
<
height
{
layer
.
frame
.
size
.
width
=
height
frame
.
size
.
width
=
height
}
else
if
width
>
height
{
layer
.
frame
.
size
.
height
=
width
frame
.
size
.
height
=
width
}
}
...
...
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