From ecfdb37f936b425dc8871337c31229dc383a2af4 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Wed, 19 Jun 2013 02:39:49 +0200 Subject: [PATCH] Adding classes according to flipX, flipY settings and flipping using css --- octoprint/server.py | 4 +++- octoprint/settings.py | 2 +- octoprint/static/css/octoprint.less | 12 ++++++++++++ octoprint/templates/index.jinja2 | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/octoprint/server.py b/octoprint/server.py index 3a619a8..f4d9aca 100644 --- a/octoprint/server.py +++ b/octoprint/server.py @@ -119,7 +119,9 @@ def index(): enableGCodeVisualizer=settings().get(["feature", "gCodeVisualizer"]), enableSystemMenu=settings().get(["system"]) is not None and settings().get(["system", "actions"]) is not None and len(settings().get(["system", "actions"])) > 0, enableAccessControl=userManager is not None, - enableSdSupport=settings().get(["feature", "sdSupport"]) + enableSdSupport=settings().get(["feature", "sdSupport"]), + webcamFlipX=settings().get(["webcam", "flipX"]), + webcamFlipY=settings().get(["webcam", "flipY"]) ) #~~ Printer control diff --git a/octoprint/settings.py b/octoprint/settings.py index aa7f33f..58da843 100644 --- a/octoprint/settings.py +++ b/octoprint/settings.py @@ -35,7 +35,7 @@ default_settings = { "snapshot": None, "ffmpeg": None, "bitrate": "5000k", - "watermark": True + "watermark": True, "flipX": False, "flipY": False }, diff --git a/octoprint/static/css/octoprint.less b/octoprint/static/css/octoprint.less index 1251ae0..5629f47 100644 --- a/octoprint/static/css/octoprint.less +++ b/octoprint/static/css/octoprint.less @@ -359,6 +359,18 @@ ul.dropdown-menu li a { #webcam_container { width: 100%; } +#webcam_container.flipX { + -webkit-transform: scaleX(-1); + -moz-transform: scaleX(-1); +} +#webcam_container.flipY { + -webkit-transform: scaleY(-1); + -moz-transform: scaleY(-1); +} +#webcam_container.flipX.flipY { + -webkit-transform: scaleX(-1) scaleY(-1); + -moz-transform: scaleX(-1) scaleY(-1); +} /** GCODE file manager */ diff --git a/octoprint/templates/index.jinja2 b/octoprint/templates/index.jinja2 index d6d4336..74e025d 100644 --- a/octoprint/templates/index.jinja2 +++ b/octoprint/templates/index.jinja2 @@ -310,7 +310,7 @@
{% if webcamStream %} -
+
{% endif %}