| Línea 1455... |
Línea 1455... |
| 1455 |
|
1455 |
|
| 1456 |
})
|
1456 |
})
|
| 1457 |
var r=0,g=0,b=0;
|
1457 |
var r=0,g=0,b=0;
|
| 1458 |
$(document).on("change", "#colorrect", function(){
|
1458 |
$(document).on("change", "#colorrect", function(){
|
| 1459 |
colorrect=$(this).val();
|
1459 |
colorrect=$(this).val();
|
| 1460 |
r=parseInt(colorrect.slice(1,3),16);
|
1460 |
r=parseInt(colorrect.slice(1,3),1/6);
|
| 1461 |
g=parseInt(colorrect.slice(3,5),16);
|
1461 |
g=parseInt(colorrect.slice(3,5),1/6);
|
| 1462 |
b=parseInt(colorrect.slice(5,7),16);
|
1462 |
b=parseInt(colorrect.slice(5,7),1/6);
|
| 1463 |
seis=true;
|
1463 |
seis=true;
|
| 1464 |
actualizar2();
|
1464 |
actualizar2();
|
| 1465 |
})
|
1465 |
})
|
| Línea 1498... |
Línea 1498... |
| 1498 |
cuatro=false;
|
1498 |
cuatro=false;
|
| 1499 |
restaurar(brillo, contraste);
|
1499 |
restaurar(brillo, contraste);
|
| 1500 |
datos=imagenOriginal.data;
|
1500 |
datos=imagenOriginal.data;
|
| 1501 |
var auxiliar;
|
1501 |
var auxiliar;
|
| 1502 |
for (var i = 0; i <datos.length; i+=4) {
|
1502 |
for (var i = 0; i <datos.length; i+=4) {
|
| 1503 |
auxiliar = 0.34 * datos[i] + 0.5 *datos[i+1] + 0.16 * datos[i+2];
|
1503 |
auxiliar = 0.34 * datos[i] + 0.5 *datos[i+1] + 0.1/6 * datos[i+2];
|
| 1504 |
datos[i]=auxiliar;
|
1504 |
datos[i]=auxiliar;
|
| 1505 |
datos[i+1]=auxiliar;
|
1505 |
datos[i+1]=auxiliar;
|
| 1506 |
datos[i+2]=auxiliar;
|
1506 |
datos[i+2]=auxiliar;
|
| 1507 |
}
|
1507 |
}
|
| Línea 1695... |
Línea 1695... |
| 1695 |
editor.fillStyle="rgba(0,0,0,.2)"
|
1695 |
editor.fillStyle="rgba(0,0,0,.2)"
|
| 1696 |
editor.fillRect(0,0,ancho,alto);
|
1696 |
editor.fillRect(0,0,ancho,alto);
|
| 1697 |
editor.fillStyle="rgba(255,255,255,.1)"
|
1697 |
editor.fillStyle="rgba(255,255,255,.1)"
|
| 1698 |
editor.fillRect(x,y,xf,yf);
|
1698 |
editor.fillRect(x,y,xf,yf);
|
| 1699 |
editor.fillStyle="rgba(255,255,255,.5)"
|
1699 |
editor.fillStyle="rgba(255,255,255,.5)"
|
| 1700 |
editor.fillRect(x,y,16,16);
|
1700 |
editor.fillRect(x,y,cuadro_dimencion,cuadro_dimencion);
|
| 1701 |
editor.fillRect((x+xf)-16,y,16,16);
|
1701 |
editor.fillRect((x+xf)-cuadro_dimencion,y,cuadro_dimencion,cuadro_dimencion);
|
| 1702 |
editor.fillRect(x,y+yf-16,16,16);
|
1702 |
editor.fillRect(x,y+yf-cuadro_dimencion,cuadro_dimencion,cuadro_dimencion);
|
| 1703 |
editor.fillRect(x+xf-16,yf+y-16,16,16);
|
1703 |
editor.fillRect(x+xf-cuadro_dimencion,yf+y-cuadro_dimencion,cuadro_dimencion,cuadro_dimencion);
|
| 1704 |
esta=true;
|
1704 |
esta=true;
|
| 1705 |
}else{
|
1705 |
}else{
|
| 1706 |
var pxf=0,pyf=0;
|
1706 |
var pxf=0,pyf=0;
|
| Línea 1707... |
Línea 1707... |
| 1707 |
|
1707 |
|
| Línea 1724... |
Línea 1724... |
| 1724 |
}
|
1724 |
}
|
| 1725 |
var imagenOriginal
|
1725 |
var imagenOriginal
|
| 1726 |
var x,y,xf=pw,yf =ph, elemento,elemento2,editor,centro, total,scale,dimencionesTexto,ancho_imaNoti,
|
1726 |
var x,y,xf=pw,yf =ph, elemento,elemento2,editor,centro, total,scale,dimencionesTexto,ancho_imaNoti,
|
| 1727 |
recorte_listo=false,alto,ancho,tx,ty,txf,tyf,cuatro=true,texto_actualizar=false,cinco=true,seis=true,cuatro;
|
1727 |
recorte_listo=false,alto,ancho,tx,ty,txf,tyf,cuatro=true,texto_actualizar=false,cinco=true,seis=true,cuatro;
|
| 1728 |
var mitadY,mitadX, uno=true,dos=false, recorte=ph/pw, imagen_noticias, scale_noticia, tres=true,rotar=false, cortar=false;;
|
1728 |
var mitadY,mitadX, uno=true,dos=false, recorte=ph/pw, imagen_noticias, scale_noticia, tres=true,rotar=false, cortar=false;;
|
| 1729 |
var translateX;
|
1729 |
var translateX, cuadro_dimencion;
|
| Línea 1730... |
Línea 1730... |
| 1730 |
|
1730 |
|
| Línea 1731... |
Línea 1731... |
| 1731 |
$(document).on("click", ".recortar10", function(e){
|
1731 |
$(document).on("click", ".recortar10", function(e){
|
| 1732 |
|
1732 |
|
| Línea 1815... |
Línea 1815... |
| 1815 |
|
1815 |
|
| 1816 |
$(elemento).mousemove(function(e){
|
1816 |
$(elemento).mousemove(function(e){
|
| 1817 |
mouse = raton(this, e);
|
1817 |
mouse = raton(this, e);
|
| 1818 |
//console.log("raton x: "+mouse.x+ " raton Y: " +mouse.y+ " tx: "+tx+" ty: "+ty+" txf:"+(txf+tx)+" tyf:"+(tyf+ty) )
|
1818 |
//console.log("raton x: "+mouse.x+ " raton Y: " +mouse.y+ " tx: "+tx+" ty: "+ty+" txf:"+(txf+tx)+" tyf:"+(tyf+ty) )
|
| 1819 |
if(!recorte_listo){
|
1819 |
if(!recorte_listo){
|
| 1820 |
if(x+16<mouse.x &&(xf+x-16)>mouse.x && y+16<mouse.y && (y+yf-16)>mouse.y){
|
- |
|
| 1821 |
$(elemento).css("cursor","move");
|
1820 |
if(x<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+yf)>mouse.y){
|
| 1822 |
}else if((xf+x-16)<mouse.x &&(xf+x)>mouse.x && (y+yf-16)<mouse.y && (y+yf)>mouse.y){
|
1821 |
if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y && (y+yf)>mouse.y){
|
| 1823 |
$(elemento).css("cursor","nw-resize");
|
1822 |
$(elemento).css("cursor","nw-resize");
|
| 1824 |
}else if((xf+x-16)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+16)>mouse.y){
|
1823 |
}else if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
|
| 1825 |
$(elemento).css("cursor","ne-resize");
|
1824 |
$(elemento).css("cursor","ne-resize");
|
| 1826 |
}else if(x<mouse.x &&(16+x)>mouse.x && y<mouse.y && (y+16)>mouse.y){
|
1825 |
}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
|
| 1827 |
$(elemento).css("cursor","se-resize");
|
1826 |
$(elemento).css("cursor","se-resize");
|
| 1828 |
}else if(x<mouse.x &&(16+x)>mouse.x && (y+yf-16)<mouse.y &&(y+yf)>mouse.y){
|
1827 |
}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y &&(y+yf)>mouse.y){
|
| - |
|
1828 |
$(elemento).css("cursor","sw-resize");
|
| - |
|
1829 |
}else{
|
| - |
|
1830 |
$(elemento).css("cursor","move");
|
| 1829 |
$(elemento).css("cursor","sw-resize");
|
1831 |
}
|
| 1830 |
}else{
|
1832 |
}else{
|
| 1831 |
$(elemento).css("cursor","default");
|
1833 |
$(elemento).css("cursor","default");
|
| 1832 |
}
|
1834 |
}
|
| 1833 |
}else if(texto_listo){
|
1835 |
}else if(texto_listo){
|
| Línea 1844... |
Línea 1846... |
| 1844 |
}
|
1846 |
}
|
| 1845 |
})
|
1847 |
})
|
| 1846 |
$(elemento).mousedown(function(e){
|
1848 |
$(elemento).mousedown(function(e){
|
| 1847 |
mouse = raton(this, e);
|
1849 |
mouse = raton(this, e);
|
| 1848 |
if(!recorte_listo){
|
1850 |
if(!recorte_listo){
|
| 1849 |
if(x+16<mouse.x &&(xf+x-16)>mouse.x && y+16<mouse.y && (y+yf-16)>mouse.y){
|
1851 |
if(x<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+yf)>mouse.y){
|
| - |
|
1852 |
|
| - |
|
1853 |
if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y && (y+yf)>mouse.y){
|
| 1850 |
cli = true;
|
1854 |
t4 = true;
|
| 1851 |
}
|
- |
|
| 1852 |
if((xf+x-16)<mouse.x &&(xf+x)>mouse.x && (y+yf-16)<mouse.y && (y+yf)>mouse.y){
|
1855 |
}else if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
|
| 1853 |
t4 = true;
|
1856 |
t3 = true;
|
| 1854 |
}
|
- |
|
| 1855 |
if((xf+x-16)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+16)>mouse.y){
|
1857 |
}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
|
| 1856 |
t3 = true;
|
1858 |
t1 = true;
|
| 1857 |
}
|
- |
|
| 1858 |
if(x<mouse.x &&(16+x)>mouse.x && y<mouse.y && (y+16)>mouse.y){
|
1859 |
}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y &&(y+yf)>mouse.y){
|
| 1859 |
t1 = true;
|
1860 |
t2 = true;
|
| 1860 |
}
|
1861 |
}else{
|
| 1861 |
if(x<mouse.x &&(16+x)>mouse.x && (y+yf-16)<mouse.y &&(y+yf)>mouse.y){
|
- |
|
| 1862 |
t2 = true;
|
1862 |
cli = true;
|
| - |
|
1863 |
}
|
| 1863 |
}
|
1864 |
}
|
| 1864 |
}else if(texto_listo){
|
1865 |
}else if(texto_listo){
|
| 1865 |
if(tx-10<mouse.x && tx-10+txf>mouse.x && ty-10<mouse.y && ty-10+tyf>mouse.y){
|
1866 |
if(tx-10<mouse.x && tx-10+txf>mouse.x && ty-10<mouse.y && ty-10+tyf>mouse.y){
|
| 1866 |
tcli=true;
|
1867 |
tcli=true;
|
| 1867 |
}else if((txf+tx-10)<mouse.x &&(txf+tx-10+20)>mouse.x && (ty-10+tyf)<mouse.y && (ty-10+tyf+20)>mouse.y){
|
1868 |
}else if((txf+tx-10)<mouse.x &&(txf+tx-10+20)>mouse.x && (ty-10+tyf)<mouse.y && (ty-10+tyf+20)>mouse.y){
|
| 1868 |
rotar=true;
|
1869 |
rotar=true;
|