diff --git a/resources/i18n/sankore_es.ts b/resources/i18n/sankore_es.ts
index 3ddd9826..1ceeccf4 100644
--- a/resources/i18n/sankore_es.ts
+++ b/resources/i18n/sankore_es.ts
@@ -769,35 +769,35 @@
Open-Sankoré
-
+ Open-Sankoré
Quit Open-Sankoré
-
+ Salir de Open-Sankoré
Open-Sankoré Editor
-
+ Editor Open-Sankoré
Show Open-Sankoré Widgets Editor
-
+ Editor de widget Open-Sankoré
Hide Open-Sankoré
-
+ Ocultar Open-Sankoré
Hide Open-Sankoré Application
-
+ Ocultar aplicación Open-Sankoré
Import Uniboard Documents
-
+ Importar documentos Uniboard
Import old Sankore or Uniboard documents
-
+ Importar viejos documentos de Sankore o Uniboard
@@ -855,7 +855,7 @@
QuaZipFile
ZIP/UNZIP API error %1
-
+ Error en API ZIP/UNZIP %1
@@ -1210,11 +1210,11 @@
UBDownloadWidget
Downloading files
-
+ Descargando archivos
Cancel
- Cancelar
+ Cancelar
@@ -1343,7 +1343,7 @@
Editable
-
+ Editable
@@ -1780,7 +1780,7 @@ Do you want to ignore these errors for this host?
UBTeacherBarWidget
Title
- Título
+ Título
Phasis
@@ -1788,15 +1788,15 @@ Do you want to ignore these errors for this host?
Duration
-
+ Duración
Equipment
-
+ Equipamiento
Activity
-
+ Actividad
@@ -1804,62 +1804,62 @@ Do you want to ignore these errors for this host?
I discover
-
+ Yo descubro
I experiment
-
+ Yo experimento
I train myself
-
+ Yo aprendo sólo
I play
-
+ Yo juego
I memorize
-
+ Yo memorizo
Short
-
+ Corto
Middle
-
+ Medio
Long
-
+ Largo
Alone
-
+ Sólo
By Group
-
+ En grupo
All together
-
+ Todos juntos
UBTeacherStudentAction
Action %0
-
+ Acción %0
Teacher
-
+ Profesor
Student
-
+ Alumno
@@ -1965,7 +1965,7 @@ Por favor reinicie la aplicación para acceder a los documentos actualizados.
Remind me later
-
+ Recordarme más tarde
@@ -2085,11 +2085,11 @@ Por favor reinicie la aplicación para acceder a los documentos actualizados.UniboardSankoreTransition
Import old Uniboard/Sankore documents
-
+ Importar documentos antiguos de Uniboard/Sankore
There are no documents that should be imported
-
+ No hay documentos a importar
@@ -2603,7 +2603,7 @@ p, li { white-space: pre-wrap; }
Open-Sankoré
-
+ Open-Sankoré
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp
index 61d3fd02..aab62431 100644
--- a/src/adaptors/UBSvgSubsetAdaptor.cpp
+++ b/src/adaptors/UBSvgSubsetAdaptor.cpp
@@ -2423,8 +2423,23 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::curtainItemToSvg(UBGraphicsCurtainIt
*/
mXmlWriter.writeStartElement(UBSettings::uniboardDocumentNamespaceUri, "curtain");
+ mXmlWriter.writeAttribute("x", QString("%1").arg(curtainItem->boundingRect().center().x()));
+ mXmlWriter.writeAttribute("y", QString("%1").arg(curtainItem->boundingRect().center().y()));
+ mXmlWriter.writeAttribute("width", QString("%1").arg(curtainItem->boundingRect().width()));
+ mXmlWriter.writeAttribute("height", QString("%1").arg(curtainItem->boundingRect().height()));
+ mXmlWriter.writeAttribute("transform", toSvgTransform(curtainItem->sceneMatrix()));
+
+ //graphicsItemToSvg(curtainItem);
+ QString zs;
+ zs.setNum(curtainItem->zValue(), 'f'); // 'f' keeps precision
+ mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "z-value", zs);
+
+ UBItem* ubItem = dynamic_cast(curtainItem);
- graphicsItemToSvg(curtainItem);
+ if (ubItem)
+ {
+ mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "uuid", UBStringUtils::toCanonicalUuid(ubItem->uuid()));
+ }
mXmlWriter.writeEndElement();
}
@@ -2436,13 +2451,17 @@ UBGraphicsCurtainItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::curtainItemFromSvg
graphicsItemFromSvg(curtainItem);
+ QStringRef svgX = mXmlReader.attributes().value("x");
+ QStringRef svgY = mXmlReader.attributes().value("y");
QStringRef svgWidth = mXmlReader.attributes().value("width");
QStringRef svgHeight = mXmlReader.attributes().value("height");
- QRectF rect = curtainItem->rect();
+
+ QRect rect;
+ rect.setX(svgX.toString().toFloat()-svgWidth.toString().toFloat()/2);
+ rect.setY(svgY.toString().toFloat()-svgHeight.toString().toFloat()/2);
rect.setWidth(svgWidth.toString().toFloat());
rect.setHeight(svgHeight.toString().toFloat());
- rect.translate(- rect.center());
curtainItem->setRect(rect);
diff --git a/src/board/UBBoardController.cpp b/src/board/UBBoardController.cpp
index 72987070..ad806dc0 100644
--- a/src/board/UBBoardController.cpp
+++ b/src/board/UBBoardController.cpp
@@ -1517,12 +1517,17 @@ void UBBoardController::updateSystemScaleFactor()
if (mActiveScene)
{
QSize pageNominalSize = mActiveScene->nominalSize();
- QSize controlSize = controlViewport();
+ //we're going to keep scale factor untouched if the size is custom
+ QMap sizesMap = UBSettings::settings()->documentSizes;
+ if(pageNominalSize == sizesMap.value(DocumentSizeRatio::Ratio16_9) || pageNominalSize == sizesMap.value(DocumentSizeRatio::Ratio4_3))
+ {
+ QSize controlSize = controlViewport();
- qreal hFactor = ((qreal)controlSize.width()) / ((qreal)pageNominalSize.width());
- qreal vFactor = ((qreal)controlSize.height()) / ((qreal)pageNominalSize.height());
+ qreal hFactor = ((qreal)controlSize.width()) / ((qreal)pageNominalSize.width());
+ qreal vFactor = ((qreal)controlSize.height()) / ((qreal)pageNominalSize.height());
- newScaleFactor = qMin(hFactor, vFactor);
+ newScaleFactor = qMin(hFactor, vFactor);
+ }
}
if (mSystemScaleFactor != newScaleFactor)
@@ -1541,7 +1546,6 @@ void UBBoardController::updateSystemScaleFactor()
mControlView->setTransform(scalingTransform);
mControlView->horizontalScrollBar()->setValue(viewState.horizontalPosition);
mControlView->verticalScrollBar()->setValue(viewState.verticalPostition);
-
}
diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp
index 95b05d01..995c70f0 100644
--- a/src/domain/UBGraphicsScene.cpp
+++ b/src/domain/UBGraphicsScene.cpp
@@ -1765,23 +1765,14 @@ void UBGraphicsScene::addMask(const QPointF ¢er)
{
UBGraphicsCurtainItem* curtain = new UBGraphicsCurtainItem(); // mem : owned and destroyed by the scene
mTools << curtain;
- QGraphicsView* view;
- if(UBApplication::applicationController->displayManager()->hasDisplay())
- view = (QGraphicsView*)UBApplication::boardController->displayView();
- else
- view = (QGraphicsView*)UBApplication::boardController->controlView();
+ addItem(curtain);
- // curtain->setZValue(toolLayerStart + toolOffsetCurtain);
- UBGraphicsItem::assignZValue(curtain, toolLayerStart + toolOffsetCurtain);
-
QRectF rect = UBApplication::boardController->activeScene()->normalizedSceneRect();
- rect.setSize(QSizeF(rect.width()/2, rect.height()/2));
-
+ rect.setRect(center.x() - rect.width()/4, center.y() - rect.height()/4, rect.width()/2 , rect.height()/2);
QPointF origin = center.isNull() ? rect.bottomRight() : center;
- curtain->setRect(rect.translated(origin - rect.topLeft() / 2));
-
- addItem(curtain);
+ curtain->setRect(rect);
+ UBGraphicsItem::assignZValue(curtain, toolLayerStart + toolOffsetCurtain);
curtain->setVisible(true);
curtain->setSelected(true);
@@ -1948,10 +1939,41 @@ void UBGraphicsScene::keyReleaseEvent(QKeyEvent * keyEvent)
{
foreach(QGraphicsItem* item, si)
{
- UBGraphicsItem *ubgi = dynamic_cast(item);
- if (ubgi)
+ switch (item->type())
{
- ubgi->remove();
+ case UBGraphicsW3CWidgetItem::Type:
+ {
+ UBGraphicsW3CWidgetItem *wc3_widget = dynamic_cast(item);
+ if (0 != wc3_widget)
+ if (!wc3_widget->hasFocus())
+ wc3_widget->remove();
+ break;
+ }
+ case UBGraphicsAppleWidgetItem::Type:
+ {
+ UBGraphicsAppleWidgetItem *Apple_widget = dynamic_cast(item);
+ if (0 !=Apple_widget)
+ if (!Apple_widget->hasFocus())
+ Apple_widget->remove();
+ break;
+ }
+ case UBGraphicsTextItem::Type:
+ {
+ UBGraphicsTextItem *text_item = dynamic_cast(item);
+ if (0 != text_item)
+ if (!text_item->hasFocus())
+ text_item->remove();
+ break;
+ }
+
+ default:
+ {
+ UBGraphicsItem *ubgi = dynamic_cast(item);
+ if (0 != ubgi)
+ ubgi->remove();
+ else
+ UBCoreGraphicsScene::removeItem(item);
+ }
}
}
}