Cambios formas

This commit is contained in:
imnavajas
2023-11-28 12:48:28 +01:00
5 changed files with 11087 additions and 10517 deletions

View File

@ -162,7 +162,11 @@ return [
'preview' => 'Previsualización de configuraciones',
'previewMaquina' => 'Configuración de máquina',
'previewConfiguracionCubierta' => 'Configuración de cubierta',
<<<<<<< HEAD
'previewEsquemaCubierta' => 'Configuración de portada',
=======
'previewEsquemaCubierta' => 'Esquema de cubierta',
>>>>>>> 594ce37f88c472a7a063e2e5c85e2c0b3899728c
'resumen' => 'Resumen del presupuesto',
'confirmar' => 'Confirmar presupuesto',

View File

@ -37,14 +37,18 @@
<?= lang("Presupuestos.previewConfiguracionCubierta") ?>
</button>
</li>
<<<<<<< HEAD
<li id="tab-preview-esquema-portada" class="nav-item">
=======
<li id="tab-preview-esquema-cubierta" class="nav-item">
>>>>>>> 594ce37f88c472a7a063e2e5c85e2c0b3899728c
<button
type="button"
class="nav-link"
role="tab"
data-bs-toggle="tab"
data-bs-target="#preview-portada"
aria-controls="preview-portada"
data-bs-target="#preview-esquema-cubierta"
aria-controls="preview-esquema-cubierta"
aria-selected="false">
<?= lang("Presupuestos.previewEsquemaCubierta") ?>
</button>
@ -204,7 +208,7 @@
</div>
</div>
<div class="tab-pane fade" id="preview-portada" role="tabpanel">
<div class="tab-pane fade" id="preview-esquema-cubierta" role="tabpanel">
<div class="row">
<div class="col-3">
<div class="p-4 mb-3 pb-3" >
@ -298,6 +302,7 @@
} );
<<<<<<< HEAD
$('#tab-preview-esquema-portada').on( "click", function() {
var altoLib = 400;
@ -309,6 +314,12 @@
solapas:0,
lomo:altoLib * 0.21};
=======
=======
$('#tab-preview-esquema-cubierta').on( "click", function() {
var altoLib = 400;
>>>>>>> 594ce37f88c472a7a063e2e5c85e2c0b3899728c
var cubiertaObjeto = {
altoLibro:220,
anchoLibro:170,
@ -316,9 +327,14 @@
anchoSolapa:70,
lomoLibro:11
};
<<<<<<< HEAD
>>>>>>> 594ce37 (Añadido preview cosido tapa blando con solapas)
previewEsquemaCubierta(portadaObjeto);
=======
previewEsquemaCubierta(cubiertaObjeto);
>>>>>>> 594ce37f88c472a7a063e2e5c85e2c0b3899728c
} );

View File

@ -46,22 +46,30 @@ function previewConfiguracionCubierta(cubiertaObj) {
formaCubierta.linewidth = 1;
// Texts
<<<<<<< HEAD
_previewConfiguracionCubierta.makeText(cubiertaObj.altoLibro, origenCubierta.x + (fullBookWith/2 -25), origenCubierta.y, styles);
_previewConfiguracionCubierta.makeText(fullBookWith, origenCubierta.x, origenCubierta.y + (cubiertaObj.altoLibro/2-15) , styles);
=======
_previewConfiguracionCubierta.makeText(cubiertaObj.altoLibro, origenCubierta.x + (fullBookWith / 2 - 25), origenCubierta.y, styles);
_previewConfiguracionCubierta.makeText(fullBookWith, origenCubierta.x, origenCubierta.y + (cubiertaObj.altoLibro / 2 - 15), styles);
>>>>>>> 594ce37f88c472a7a063e2e5c85e2c0b3899728c
_previewConfiguracionCubierta.update();
// Update preview info fields
$('#prevLibro').text(cubiertaObj.anchoLibro + "X" + cubiertaObj.altoLibro );
$('#prevLibro').text(cubiertaObj.anchoLibro + "X" + cubiertaObj.altoLibro);
$('#prevLomo').text(cubiertaObj.lomo);
$('#prevSolapas').text(cubiertaObj.solapas);
}
<<<<<<< HEAD
<<<<<<< HEAD
function previewEsquemaCubierta(portadaObj) {
=======
=======
>>>>>>> 594ce37f88c472a7a063e2e5c85e2c0b3899728c
function previewEsquemaCubierta(objEC) {
// Variables locales
@ -87,11 +95,15 @@ function previewEsquemaCubierta(objEC) {
lomoLibro = anchoSangrado * 0.09;
anchoCubierta = (2 * anchoLibro) + (2 * anchoSolapa) + lomoLibro;
}
<<<<<<< HEAD
>>>>>>> 594ce37 (Añadido preview cosido tapa blando con solapas)
=======
>>>>>>> 594ce37f88c472a7a063e2e5c85e2c0b3899728c
// Clear the canvas element
$('#draw-portada').empty();
// Get the element for placing the graphical elements
<<<<<<< HEAD
var divPortada = document.getElementById('draw-portada');
var _previewEsquemaCubierta = new Two({fitted: true}).appendTo(divPortada);
// Calculate the center of the canvas element
@ -115,6 +127,13 @@ function previewEsquemaCubierta(objEC) {
libro.stroke = '#6997D3';
libro.fill = '#6997D3';
=======
=======
var divEC = document.getElementById('draw-portada');
var previewEC = new Two({fitted: true}).appendTo(divEC);
// Calculate the center of the canvas element
var origenEC = new Two.Vector(previewEC.width / 2, previewEC.height / 2);
>>>>>>> 594ce37f88c472a7a063e2e5c85e2c0b3899728c
var sangrado = previewEC.makeRectangle(
origenEC.x,
origenEC.y,
@ -167,6 +186,7 @@ function previewEsquemaCubierta(objEC) {
((2 * anchoLibro) + lomoLibro),
altoLibro);
libro.stroke = 'black';
<<<<<<< HEAD
>>>>>>> 594ce37 (Añadido preview cosido tapa blando con solapas)
libro.linewidth = 1;
@ -252,6 +272,82 @@ function previewEsquemaCubierta(objEC) {
$('#prevLomo').text(objEC.lomoLibro);
$('#prevSolapas').text(objEC.solapas);
>>>>>>> 594ce37 (Añadido preview cosido tapa blando con solapas)
=======
libro.linewidth = 1;
var lomo = previewEC.makeRectangle(
origenEC.x,
origenEC.y,
lomoLibro,
altoLibro);
lomo.stroke = 'black';
lomo.fill = '#F4F8F2';
lomo.linewidth = 1;
// Cotas
var cotaAnchoCubierta = previewEC.makeDobleArrow(
origenEC.x - (anchoCubierta / 2),
origenEC.y + (altoLibro / 2) + 35,
origenEC.x + (anchoCubierta / 2),
origenEC.y + (altoLibro / 2) + 35,
10);
cotaAnchoCubierta.linewidth = 2;
var cotaAltoLibro = previewEC.makeDobleArrow(
origenEC.x + (anchoCubierta / 2) + 35,
origenEC.y + (altoLibro / 2),
origenEC.x + (anchoCubierta / 2) + 35,
origenEC.y - (altoLibro / 2),
10);
cotaAltoLibro.linewidth = 2;
var cotaLomo = previewEC.makeDobleArrow(
origenEC.x - (lomoLibro / 2),
origenEC.y + (altoLibro / 3),
origenEC.x + (lomoLibro / 2),
origenEC.y + (altoLibro / 3),
10);
cotaLomo.linewidth = 2;
var cotaContraportada = previewEC.makeDobleArrow(
origenEC.x - (lomoLibro / 2 + anchoLibro),
origenEC.y - (altoLibro / 3),
origenEC.x - (lomoLibro / 2),
origenEC.y - (altoLibro / 3),
10);
cotaContraportada.linewidth = 2;
var cotaPortada = previewEC.makeDobleArrow(
origenEC.x + (lomoLibro / 2),
origenEC.y - (altoLibro / 3),
origenEC.x + (lomoLibro / 2 + anchoLibro),
origenEC.y - (altoLibro / 3),
10);
cotaPortada.linewidth = 2;
// Textos:
// Titulos generales
let stylesEC = {size: 22, weight: 'bold', family: 'Public Sans'};
previewEC.makeText("Portada", origenEC.x + (lomoLibro + anchoLibro) / 2, origenEC.y, stylesEC);
previewEC.makeText("Contraportada", origenEC.x - (lomoLibro + anchoLibro) / 2, origenEC.y, stylesEC);
let a = previewEC.makeText("Lomo", origenEC.x, origenEC.y, stylesEC).rotation = -Math.PI / 2;
// Sangrados
let styleSangrado = {size: 10, family: 'Public Sans', style: 'italic', fill: 'red'};
previewEC.makeText("Sangrado 3 mm", origenEC.x, origenEC.y + (altoLibro / 2 + 20), styleSangrado);
previewEC.makeText("Sangrado 3 mm", origenEC.x, origenEC.y - (altoLibro / 2 + 20), styleSangrado);
previewEC.makeText("Sangrado 3 mm", origenEC.x + (lomoLibro / 2 + anchoLibro + anchoSolapa + 20), origenEC.y, styleSangrado).rotation = -Math.PI / 2;
previewEC.makeText("Sangrado 3 mm", origenEC.x - (lomoLibro / 2 + anchoLibro + anchoSolapa + 20), origenEC.y, styleSangrado).rotation = -Math.PI / 2;
// Cotas
previewEC.makeText(objEC.lomoLibro + " mm", origenEC.x, origenEC.y + (altoLibro / 3) + 15, styleCotas);
previewEC.makeText(objEC.anchoLibro + " mm", origenEC.x - (lomoLibro / 2 + anchoLibro / 2), origenEC.y - (altoLibro / 3) + 15, styleCotas);
previewEC.makeText(objEC.anchoLibro + " mm", origenEC.x + (lomoLibro / 2 + anchoLibro / 2), origenEC.y - (altoLibro / 3) + 15, styleCotas);
previewEC.makeText(objEC.altoLibro + " mm", origenEC.x + (lomoLibro / 2 + anchoLibro + anchoSolapa) + 50, origenEC.y, styleCotas).rotation = -Math.PI / 2;
previewEC.makeText(objEC.anchoCubierta + " mm", origenEC.x, origenEC.y + (altoLibro / 2) + 50, styleCotas);
previewEC.update();
// Update preview info fields
$('#prevLibro').text(objEC.anchoLibro + "X" + objEC.altoLibro);
$('#prevLomo').text(objEC.lomoLibro);
$('#prevSolapas').text(objEC.solapas);
>>>>>>> 594ce37f88c472a7a063e2e5c85e2c0b3899728c
}

View File

@ -93,6 +93,6 @@ table.dataTable.table-hover>tbody>tr.selected:hover>* {
div.draw-shapes {
width: 95%;
height: 500px;
height: 550px;
margin: 2.5% auto;
}

File diff suppressed because it is too large Load Diff