Toggle navigation
Toggle navigation
This project
Loading...
Sign in
尹诚
/
Mapbox-iOS-SDK
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
Thomas Rasch
13 years ago
Commit
ccdc7282692b34f47e0c9f859f896638c0ee0a10
1 parent
4e67967d
o Updated RMCircle to use setPosition:animated:
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
MapView/Map/RMCircle.m
MapView/Map/RMCircle.m
View file @
ccdc728
...
...
@@ -35,7 +35,7 @@
@interface
RMCircle
()
-
(
void
)
updateCirclePath
;
-
(
void
)
updateCirclePath
Animated
:
(
BOOL
)
animated
;
@end
...
...
@@ -68,7 +68,7 @@
enableDragging
=
YES
;
circlePath
=
NULL
;
[
self
updateCirclePath
];
[
self
updateCirclePath
Animated
:
NO
];
return
self
;
}
...
...
@@ -85,7 +85,7 @@
#pragma mark -
-
(
void
)
updateCirclePath
-
(
void
)
updateCirclePath
Animated
:
(
BOOL
)
animated
{
CGPathRelease
(
circlePath
);
circlePath
=
NULL
;
...
...
@@ -102,7 +102,7 @@
CGFloat
offset
=
floorf
(
-
lineWidthInPixels
/
2
.
0
f
)
-
2
;
CGRect
newBoundsRect
=
CGRectInset
(
rectangle
,
offset
,
offset
);
[
self
setBounds
:
newBoundsRect
];
// DLog(@"Circle Rectangle: %f, %f, %f, %f", rectangle.origin.x, rectangle.origin.y, rectangle.size.width, rectangle.size.height);
...
...
@@ -113,14 +113,14 @@
// animate the path change if we're in an animation block
//
if
(
[
CATransaction
animationDuration
]
>
0
)
if
(
animated
)
{
CABasicAnimation
*
pathAnimation
=
[
CABasicAnimation
animationWithKeyPath
:
@"path"
];
pathAnimation
.
duration
=
[
CATransaction
animationDuration
];
pathAnimation
.
fromValue
=
[
NSValue
valueWithPointer
:
self
.
shapeLayer
.
path
];
pathAnimation
.
toValue
=
[
NSValue
valueWithPointer
:
newPath
];
[
self
.
shapeLayer
addAnimation
:
pathAnimation
forKey
:
@"animatePath"
];
}
...
...
@@ -138,7 +138,7 @@
{
[
lineColor
release
];
lineColor
=
[
newLineColor
retain
];
[
self
updateCirclePath
];
[
self
updateCirclePath
Animated
:
NO
];
}
}
...
...
@@ -148,27 +148,27 @@
{
[
fillColor
release
];
fillColor
=
[
newFillColor
retain
];
[
self
updateCirclePath
];
[
self
updateCirclePath
Animated
:
NO
];
}
}
-
(
void
)
setRadiusInMeters
:
(
CGFloat
)
newRadiusInMeters
{
radiusInMeters
=
newRadiusInMeters
;
[
self
updateCirclePath
];
[
self
updateCirclePath
Animated
:
NO
];
}
-
(
void
)
setLineWidthInPixels
:
(
CGFloat
)
newLineWidthInPixels
{
lineWidthInPixels
=
newLineWidthInPixels
;
[
self
updateCirclePath
];
[
self
updateCirclePath
Animated
:
NO
];
}
-
(
void
)
setPosition
:
(
CGPoint
)
position
-
(
void
)
setPosition
:
(
CGPoint
)
position
animated
:
(
BOOL
)
animated
{
[
s
uper
setPosition
:
position
];
[
s
elf
setPosition
:
position
];
[
self
updateCirclePath
];
[
self
updateCirclePath
Animated
:
animated
];
}
@end
...
...
Please
register
or
login
to post a comment