You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2018/08/22 04:56:31 UTC

[openmeetings] branch master updated: [OPENMEETINGS-1884] rotating arrow is added, clipart drawing is improved

This is an automated email from the ASF dual-hosted git repository.

solomax pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openmeetings.git


The following commit(s) were added to refs/heads/master by this push:
     new 9bd6315  [OPENMEETINGS-1884] rotating arrow is added, clipart drawing is improved
9bd6315 is described below

commit 9bd631503709e4433d9fb81d60ff018d695ddd40
Author: Maxim Solodovnik <so...@gmail.com>
AuthorDate: Wed Aug 22 11:54:41 2018 +0700

    [OPENMEETINGS-1884] rotating arrow is added, clipart drawing is improved
---
 .../openmeetings/web/room/wb/raw-tool-clipart.js   |  14 +--
 .../apache/openmeetings/web/room/wb/raw-wb-area.js |  11 ++
 .../openmeetings/web/room/wb/raw-wb-board.js       |  11 +-
 .../src/main/webapp/images/arcArrow.png            | Bin 0 -> 495 bytes
 .../src/main/webapp/images/arcArrow.svg            | 113 +++++++++++++++++++++
 .../src/main/webapp/public/cliparts/ambulance.png  | Bin 2243 -> 1277 bytes
 .../src/main/webapp/public/cliparts/bow.png        | Bin 2981 -> 1661 bytes
 .../src/main/webapp/public/cliparts/community.png  | Bin 2231 -> 1262 bytes
 .../src/main/webapp/public/cliparts/help.png       | Bin 1496 -> 823 bytes
 .../src/main/webapp/public/cliparts/home.png       | Bin 1428 -> 706 bytes
 .../src/main/webapp/public/cliparts/idea.png       | Bin 3199 -> 1791 bytes
 .../src/main/webapp/public/cliparts/swim.png       | Bin 2920 -> 1759 bytes
 12 files changed, 142 insertions(+), 7 deletions(-)

diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-tool-clipart.js b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-tool-clipart.js
index de4a0f2..75bedde 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-tool-clipart.js
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-tool-clipart.js
@@ -10,8 +10,8 @@ var Clipart = function(wb, btn, s) {
 			art.obj = img.set({
 				left: art.orig.x
 				, top: art.orig.y
-				, width: 0
-				, height: 0
+				, scaleX: 0.
+				, scaleY: 0.
 				, omType: 'Clipart'
 				, _src: imgSrc
 				, opacity: art.opacity
@@ -23,11 +23,13 @@ var Clipart = function(wb, btn, s) {
 		if (!art.obj) {
 			return; // not ready
 		}
-		const dx = pointer.x - art.orig.x, dy = pointer.y - art.orig.y
-			, d = Math.sqrt(dx * dx + dy * dy);
+		const dx = pointer.x - art.orig.x
+			, dy = pointer.y - art.orig.y
+			, d = Math.sqrt(dx * dx + dy * dy)
+			, scale = d / art.obj.width;
 		art.obj.set({
-			width: d
-			, height: art.orig.height * d / art.orig.width
+			scaleX: scale
+			, scaleY: scale
 			, angle: Math.atan2(dy, dx) * 180 / Math.PI
 		});
 	};
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-area.js b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-area.js
index 1f4bdb4..2aa4b21 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-area.js
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-area.js
@@ -349,3 +349,14 @@ var DrawWbArea = function() {
 	self.updateAreaClass = function() {};
 	return self;
 };
+if ('function' !== window.originalDrawControl) {
+	window.originalDrawControl = fabric.Object.prototype._drawControl;
+	fabric.Object.prototype._drawControl = function(control, ctx, methodName, left, top) {
+		const size = this.cornerSize;
+		if (this.canvas.controlCallback && 'function' === typeof(this.canvas.controlCallback[control])) {
+			this.canvas.controlCallback[control](ctx, left, top, size);
+		} else {
+			window.originalDrawControl.call(this, control, ctx, methodName, left, top);
+		}
+	};
+}
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-board.js b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-board.js
index d4b16da..f0adcf6 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-board.js
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-board.js
@@ -2,7 +2,9 @@
 var Wb = function() {
 	const ACTIVE = 'active', BUMPER = 100, wb = {id: -1, name: ''}, canvases = []
 		, area = $('.room.wb.area .wb-area .tabs.ui-tabs'), bar = area.find('.wb-tabbar')
-		, extraProps = ['uid', 'fileId', 'fileType', 'count', 'slide', 'omType', '_src', 'formula'];
+		, extraProps = ['uid', 'fileId', 'fileType', 'count', 'slide', 'omType', '_src', 'formula']
+		, arrowImg = new Image();
+	arrowImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAICAYAAADqSp8ZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAygAAAMoBawMUsgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAFsSURBVCiRrdI/SEJRFMfx37lPGxqKoGwxKJoaImhpCf8NEUFL9WgLUrPnIyEIa6reVEPQn0GeWDS4NDQETQ2JT4waojUoHBqCoJKWINB3720yIhGl+q7ncj5nuIQ6jWiaq1xmU4IwBACQ5GCAU5D8IECRAkUQzt8V++wmlSrX20e1BoFIrFdwHidIIQhH5O68sgzD/vnOF4m0QyijJGgMQIHZtJdJJ4oNg6qqNr20dKwBaOWKvZFPpZ7qXV3JH4wNSMbjJHGZ7XIlYRiiFkiBsL4CphwLwbck5E7uwMw3ClXD2iRIm [...]
 	let a, t, z, s, f, mode, slide = 0, width = 0, height = 0
 			, zoom = 1., zoomMode = 'pageWidth', role = null;
 
@@ -646,6 +648,13 @@ var Wb = function() {
 		a.find('.canvases').append(c);
 		const canvas = new fabric.Canvas(c.attr('id'), {
 			preserveObjectStacking: true
+			, controlCallback: {
+				mtr: function mtrControlCallback (ctx, left, top, size) {
+					const x = left + (size - arrowImg.width) / 2
+						, y = top + (size - arrowImg.height) / 2;
+					ctx.drawImage(arrowImg, x, y);
+				}
+			}
 		});
 		canvas.wbId = wb.id;
 		canvas.slide = sl;
diff --git a/openmeetings-web/src/main/webapp/images/arcArrow.png b/openmeetings-web/src/main/webapp/images/arcArrow.png
new file mode 100644
index 0000000..70a5bf0
Binary files /dev/null and b/openmeetings-web/src/main/webapp/images/arcArrow.png differ
diff --git a/openmeetings-web/src/main/webapp/images/arcArrow.svg b/openmeetings-web/src/main/webapp/images/arcArrow.svg
new file mode 100644
index 0000000..2eecd40
--- /dev/null
+++ b/openmeetings-web/src/main/webapp/images/arcArrow.svg
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+  
+      http://www.apache.org/licenses/LICENSE-2.0
+    	  
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+  
+-->
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="210mm"
+   height="297mm"
+   viewBox="0 0 744.09448819 1052.3622047"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.91 r13725"
+   inkscape:export-filename="AAAA"
+   inkscape:export-xdpi="5.1300001"
+   inkscape:export-ydpi="5.1300001"
+   sodipodi:docname="arcArrow.svg">
+  <defs
+     id="defs4">
+    <marker
+       inkscape:stockid="Arrow1Mend"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow1Mend"
+       style="overflow:visible;"
+       inkscape:isstock="true">
+      <path
+         id="path4159"
+         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+         style="fill-rule:evenodd;stroke:#40636a;stroke-width:1pt;stroke-opacity:1;fill:#40636a;fill-opacity:1"
+         transform="scale(0.4) rotate(180) translate(10,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Mstart"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow1Mstart"
+       style="overflow:visible"
+       inkscape:isstock="true">
+      <path
+         id="path4156"
+         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+         style="fill-rule:evenodd;stroke:#40636a;stroke-width:1pt;stroke-opacity:1;fill:#40636a;fill-opacity:1"
+         transform="scale(0.4) translate(10,0)" />
+    </marker>
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.35"
+     inkscape:cx="-109.28571"
+     inkscape:cy="520"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1351"
+     inkscape:window-height="1026"
+     inkscape:window-x="49"
+     inkscape:window-y="54"
+     inkscape:window-maximized="1" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:#40636a;stroke-width:10.95300007;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#Arrow1Mstart);marker-end:url(#Arrow1Mend)"
+       d="M 125.11618,395.56385 C 290.11847,225.06324 437.32316,260.61039 594.88382,401.73199"
+       id="path4144"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cc" />
+  </g>
+</svg>
diff --git a/openmeetings-web/src/main/webapp/public/cliparts/ambulance.png b/openmeetings-web/src/main/webapp/public/cliparts/ambulance.png
index c61cc33..65d9d43 100644
Binary files a/openmeetings-web/src/main/webapp/public/cliparts/ambulance.png and b/openmeetings-web/src/main/webapp/public/cliparts/ambulance.png differ
diff --git a/openmeetings-web/src/main/webapp/public/cliparts/bow.png b/openmeetings-web/src/main/webapp/public/cliparts/bow.png
index 43cc3f5..7864bfb 100644
Binary files a/openmeetings-web/src/main/webapp/public/cliparts/bow.png and b/openmeetings-web/src/main/webapp/public/cliparts/bow.png differ
diff --git a/openmeetings-web/src/main/webapp/public/cliparts/community.png b/openmeetings-web/src/main/webapp/public/cliparts/community.png
index d56e169..5f18b81 100644
Binary files a/openmeetings-web/src/main/webapp/public/cliparts/community.png and b/openmeetings-web/src/main/webapp/public/cliparts/community.png differ
diff --git a/openmeetings-web/src/main/webapp/public/cliparts/help.png b/openmeetings-web/src/main/webapp/public/cliparts/help.png
index 6b7db6a..42516c9 100644
Binary files a/openmeetings-web/src/main/webapp/public/cliparts/help.png and b/openmeetings-web/src/main/webapp/public/cliparts/help.png differ
diff --git a/openmeetings-web/src/main/webapp/public/cliparts/home.png b/openmeetings-web/src/main/webapp/public/cliparts/home.png
index 149583c..be0dafa 100644
Binary files a/openmeetings-web/src/main/webapp/public/cliparts/home.png and b/openmeetings-web/src/main/webapp/public/cliparts/home.png differ
diff --git a/openmeetings-web/src/main/webapp/public/cliparts/idea.png b/openmeetings-web/src/main/webapp/public/cliparts/idea.png
index cc2a3c7..c45e944 100644
Binary files a/openmeetings-web/src/main/webapp/public/cliparts/idea.png and b/openmeetings-web/src/main/webapp/public/cliparts/idea.png differ
diff --git a/openmeetings-web/src/main/webapp/public/cliparts/swim.png b/openmeetings-web/src/main/webapp/public/cliparts/swim.png
index fbb6f25..1669528 100644
Binary files a/openmeetings-web/src/main/webapp/public/cliparts/swim.png and b/openmeetings-web/src/main/webapp/public/cliparts/swim.png differ