Skip to content

Commit

Permalink
Use element dimensions for painting
Browse files Browse the repository at this point in the history
  • Loading branch information
wasnotrice committed Jun 5, 2014
1 parent b575135 commit 087fb06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/shoes/swt/shape.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def arc(x, y, width, height, start_angle, arc_angle)
end

def update_position
transform.translate(dsl.absolute_left, dsl.absolute_top)
transform.translate(dsl.element_left, dsl.element_top)
end

def left
Expand Down
6 changes: 3 additions & 3 deletions spec/swt_shoes/shape_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
allow(::Swt::Transform).to receive(:new) { transform }
end

it "delegates #move" do
allow(dsl).to receive(:absolute_left) { 20 }
allow(dsl).to receive(:absolute_top) { 30 }
it "translates position to dsl's element_left and element_top" do
allow(dsl).to receive(:element_left) { 20 }
allow(dsl).to receive(:element_top) { 30 }
expect(transform).to receive(:translate).with(20, 30)
subject.update_position
end
Expand Down

0 comments on commit 087fb06

Please sign in to comment.