Skip to content

Instantly share code, notes, and snippets.

@alex-hhh
Created February 28, 2018 12:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alex-hhh/c8b9c9bb7de29a4c993cd99147fc9809 to your computer and use it in GitHub Desktop.
Save alex-hhh/c8b9c9bb7de29a4c993cd99147fc9809 to your computer and use it in GitHub Desktop.
plot-doc/plot/scribblings/plotting.scrbl | 2 +-
plot-doc/plot/scribblings/renderer2d.scrbl | 2 +-
plot-gui-lib/plot/private/gui/snip2d.rkt | 25 +++++++++++++------------
plot-gui-lib/plot/snip.rkt | 2 +-
4 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/plot-doc/plot/scribblings/plotting.scrbl b/plot-doc/plot/scribblings/plotting.scrbl
index fa78670..b67fc8a 100644
--- a/plot-doc/plot/scribblings/plotting.scrbl
+++ b/plot-doc/plot/scribblings/plotting.scrbl
@@ -94,7 +94,7 @@ The @(racket #:az) and @(racket #:alt) keyword arguments are backward-compatible
}
@defproc[(plot-snip [<plot-argument> <plot-argument-contract>] ...)
- (is-a?/c 2d-plot-snip+c%)]
+ (is-a?/c 2d-plot-snip%)]
@defproc[(plot3d-snip [<plot-argument> <plot-argument-contract>] ...)
(is-a?/c snip%)]
@defproc[(plot-frame [<plot-argument> <plot-argument-contract>] ...)
diff --git a/plot-doc/plot/scribblings/renderer2d.scrbl b/plot-doc/plot/scribblings/renderer2d.scrbl
index 4233a4e..f14fa82 100644
--- a/plot-doc/plot/scribblings/renderer2d.scrbl
+++ b/plot-doc/plot/scribblings/renderer2d.scrbl
@@ -948,7 +948,7 @@ graphics element.}
the plot, without specifying a label for them}
]
-@defclass[2d-plot-snip+c% snip% ()]{
+@defclass[2d-plot-snip% snip% ()]{
An instance of this class is returned by @racket[plot-snip].
diff --git a/plot-gui-lib/plot/private/gui/snip2d.rkt b/plot-gui-lib/plot/private/gui/snip2d.rkt
index fec838a..e4e6f6f 100644
--- a/plot-gui-lib/plot/private/gui/snip2d.rkt
+++ b/plot-gui-lib/plot/private/gui/snip2d.rkt
@@ -15,9 +15,19 @@
"worker-thread.rkt"
"snip.rkt")
-(provide make-2d-plot-snip
- plot-mouse-event-callback/c
- 2d-plot-snip+c%)
+(define plot-mouse-event-callback/c
+ (-> (is-a?/c snip%) (is-a?/c mouse-event%) (or/c real? #f) (or/c real? #f) any/c))
+(define 2d-plot-snip+c%
+ (class/c
+ (set-mouse-event-callback (->m (or/c plot-mouse-event-callback/c #f) any/c))
+ (set-overlay-renderers (->m (or/c (treeof renderer2d?) #f) any/c))))
+
+(provide (contract-out (make-2d-plot-snip
+ (-> any/c any/c any/c any/c
+ any/c any/c any/c
+ 2d-plot-snip+c%))
+ (2d-plot-snip% 2d-plot-snip+c%))
+ plot-mouse-event-callback/c)
(define update-delay 16)
(define show-zoom-message? #t)
@@ -356,15 +366,6 @@
(super resize w h))
))
-(define plot-mouse-event-callback/c (-> (is-a?/c snip%) (is-a?/c mouse-event%)
- (or/c real? #f) (or/c real? #f) any/c))
-
-(define/contract 2d-plot-snip+c%
- (class/c
- (set-mouse-event-callback (->m (or/c plot-mouse-event-callback/c #f) any/c))
- (set-overlay-renderers (->m (or/c (treeof renderer2d?) #f) any/c)))
- 2d-plot-snip%)
-
(define (make-2d-plot-snip
init-bm saved-plot-parameters
make-bm plot-bounds-rect area width height)
diff --git a/plot-gui-lib/plot/snip.rkt b/plot-gui-lib/plot/snip.rkt
index 6a79474..31d3200 100644
--- a/plot-gui-lib/plot/snip.rkt
+++ b/plot-gui-lib/plot/snip.rkt
@@ -4,4 +4,4 @@
(provide
plot-mouse-event-callback/c
- 2d-plot-snip+c%)
+ 2d-plot-snip%)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment