Click here to Skip to main content
15,890,185 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi All,

i m using the slider but their is some mistake in increase the size problem is :- when i increase the size of the text it take the previous value of the size Example:-

First write the text any size after that i set the size 10 after that again set the size 20 then it take the size 10 if i take the size 35 then it take the size 20 so similarly this is happened

so please help me asap.
JavaScript
$("#Textslider").change(function () {
               var textsize = null;
        if (getSelectedLayer() != null) {
            textsize = $(this).val();        
            var canvasobj = getSelectedLayer();        
            canvasobj.fontSize = textsize;
            this.context = canvasobj.context;
            this.textWidth = this.context.measureText(canvasobj.content).width;
            this.textHeight = (parseInt(textsize) + (textsize / 4));

            jCollage.TextResize(this.textWidth, this.textHeight, textsize, canvasobj, this.context);
            //jCollage.redraw();
        }
    });

 this.TextResize = function (textWidth, textHeight, fontSize, selectedLayer, context) {
       
        this.fontSize = fontSize;
        this.selectedLayer = selectedLayer;
        this.context = context;
        this.textWidth = textWidth;
        this.textHeight = textHeight;

        this.selectedLayer.scale(parseInt(this.textWidth + 30), this.textHeight);
        drawMarker(this.selectedLayer);
    }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900