Skip to content

Commit

Permalink
Merge pull request #113 from timholy/teh/set_coordinates
Browse files Browse the repository at this point in the history
Fix set_coords->set_coordinates deprecation
  • Loading branch information
timholy authored Mar 27, 2017
2 parents 2225e7d + 593ceed commit 53965ae
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tk
Winston
Graphics 0.1
Cairo
Graphics
Graphics 0.2
FileIO
AxisArrays
StatsBase
2 changes: 1 addition & 1 deletion src/ImageView.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ __precompile__(false)
module ImageView

using Graphics
import Graphics: width, height, fill, set_coords, xmin, xmax, ymin, ymax
import Graphics: width, height, fill, set_coordinates, xmin, xmax, ymin, ymax

using FileIO
using Cairo
Expand Down
6 changes: 3 additions & 3 deletions src/annotations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ abstract AbstractAnnotation
# Use this type when you want your annotation to be linked to particular data-coordinates
# (for example, to highlight a particular data point)
# devicebb(data) returns a BoundingBox in device coordinates, userbb(data) returns one in user coordinates.
# It's up to the draw() function to decide how to exploit these (most commonly, with set_coords())
# It's up to the draw() function to decide how to exploit these (most commonly, with set_coordinates())
type AnchoredAnnotation{T} <: AbstractAnnotation
devicebb::Function
userbb::Function
Expand Down Expand Up @@ -207,7 +207,7 @@ function draw(c::Canvas, ann::AnchoredAnnotation)
ctx = getgc(c)
Graphics.save(ctx)
data = ann.data
set_coords(ctx, ann.devicebb(data), ann.userbb(data))
set_coordinates(ctx, ann.devicebb(data), ann.userbb(data))
scale_x = width(ann.userbb(data))/width(ann.devicebb(data))
scale_y = height(ann.userbb(data))/height(ann.devicebb(data))
draw_anchored(ctx, data, scale_x, scale_y)
Expand All @@ -219,7 +219,7 @@ function draw{T}(c::Canvas, ann::FloatingAnnotation{AnnotationScalebarFixed{T}})
ctx = getgc(c)
Graphics.save(ctx)
data = ann.data
set_coords(ctx, ann.devicebb(data), BoundingBox(0,1,0,1))
set_coordinates(ctx, ann.devicebb(data), BoundingBox(0,1,0,1))
set_source(ctx, data.color)
w, h = data.getsize(data.width, data.height)
bb = BoundingBox(-w/2+data.centerx, w/2+data.centerx, -h/2+data.centery, h/2+data.centery)
Expand Down
10 changes: 5 additions & 5 deletions src/display.jl
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ end
function resize(imgc::ImageCanvas, img2::ImageSlice2d)
w, h = size(imgc.surface.data)
setbb!(imgc, w, h)
set_coords(imgc, img2.zoombb)
set_coordinates(imgc, img2.zoombb)
r = getgc(imgc.c)
if !is(imgc.aspect_x_per_y, nothing)
fill(r, imgc.perimeter)
Expand Down Expand Up @@ -612,7 +612,7 @@ function panzoom(imgc::ImageCanvas, img2::ImageSlice2d, bb::BoundingBox)
rerender(imgc, img2)
end

function set_coords(imgc::ImageCanvas, bb::BoundingBox)
function set_coordinates(imgc::ImageCanvas, bb::BoundingBox)
l, r = bb.xmin, bb.xmax
if imgc.flipx
l, r = r, l
Expand All @@ -622,7 +622,7 @@ function set_coords(imgc::ImageCanvas, bb::BoundingBox)
t, b = b, t
end
bb = imgc.canvasbb
set_coords(getgc(imgc.c), bb.xmin, bb.ymin, width(bb), height(bb), l, r, t, b)
set_coordinates(getgc(imgc.c), bb.xmin, bb.ymin, width(bb), height(bb), l, r, t, b)
end

function panvert(imgc::ImageCanvas, img2::ImageSlice2d, delta)
Expand All @@ -638,7 +638,7 @@ function panvert(imgc::ImageCanvas, img2::ImageSlice2d, delta)
bb = img2.zoombb
bb = BoundingBox(bb.xmin, bb.xmax, bb.ymin+dy, bb.ymax+dy)
panzoom(imgc, img2, bb)
set_coords(imgc, bb)
set_coordinates(imgc, bb)
redraw(imgc)
end
end
Expand All @@ -656,7 +656,7 @@ function panhorz(imgc::ImageCanvas, img2::ImageSlice2d, delta)
bb = img2.zoombb
bb = BoundingBox(bb.xmin+dx, bb.xmax+dx, bb.ymin, bb.ymax)
panzoom(imgc, img2, bb)
set_coords(imgc, bb)
set_coordinates(imgc, bb)
redraw(imgc)
end
end
Expand Down

0 comments on commit 53965ae

Please sign in to comment.