Skip to content
Browse files

Remove rectangle function from API, keep internally for use by inters…

…ects*?
  • Loading branch information...
1 parent 912d154 commit bc600e21fb3f3319f4f0eb848587b481fbf53fd0 @semperos committed
Showing with 9 additions and 9 deletions.
  1. +0 −1 src/clj_webdriver/core.clj
  2. +9 −8 src/clj_webdriver/core_element.clj
View
1 src/clj_webdriver/core.clj
@@ -94,7 +94,6 @@
(location [element] "Given an element object, return its location as a map of its x/y coordinates")
(location-once-visible [element] "Given an element object, return its location on the screen once it is scrolled into view as a map of its x/y coordinates. The window will scroll as much as possible until the element hits the top of the page; thus even visible elements will be scrolled until they reach that point.")
(present? [element] "Returns true if the element exists and is visible")
- (rectangle [element] "Given an `element`, return a `java.awt.Rectangle` with the same dimensions.")
(size [element] "Return the size of the given `element` as a map containing `:width` and `:height` values in pixels.")
(tag [element] "Retrieve the name of the HTML tag of the given element object (returned as a keyword)")
(text [element] "Retrieve the content, or inner HTML, of a given element object")
View
17 src/clj_webdriver/core_element.clj
@@ -7,6 +7,15 @@
;; * ISelectElement
(in-ns 'clj-webdriver.core)
+(defn rectangle
+ [element]
+ (let [loc (location element)
+ el-size (size element)]
+ (java.awt.Rectangle. (:x loc)
+ (:y loc)
+ (:width el-size)
+ (:height el-size))))
+
(extend-type Element
;; Element action basics
@@ -86,14 +95,6 @@
h (.height size-obj)]
{:width w, :height h}))
- (rectangle [element]
- (let [loc (location element)
- el-size (size element)]
- (java.awt.Rectangle. (:x loc)
- (:y loc)
- (:width el-size)
- (:height el-size))))
-
(intersects*? [element-a element-b]
(let [rect-a (rectangle element-a)
rect-b (rectangle element-b)]

0 comments on commit bc600e2

Please sign in to comment.
Something went wrong with that request. Please try again.