Jump to content


Photo

Text BoundingBox vs Raw PixelRect


  • Please log in to reply
6 replies to this topic

#1 mitya777

mitya777

    FireStarter

  • Members
  • PipPip
  • 28 posts

Posted 10 February 2011 - 03:04 PM

Hi guys, I was wondering whether it was possible to set the bounding box around a text object so that it comes right up to the actual pixels. Is this possible at all? Is this possible via the API?

I know that the text object has the rawTop and rawLeft properties, but as far as I see there is no rawHeight and rawWidth. I guess I can figure out what the difference is between the left and rawLeft and assume that the padding is consistent, but this seems hackey, and still leaves the problem of the setting the bounding box to those dimensions.

So in other words, I'd like to make it so that when a text object is selected the bounding box comes up right to the actual characters and this is reflected in the height and width properties of the text object whose left and top property should now match up with the rawLeft and rawTop properties. Any ideas?

Thank you in advance for all of your help!

#2 fuuuuu

fuuuuu

    FireworksFreak

  • Members
  • PipPip
  • 19 posts

Posted 10 February 2011 - 03:10 PM

Hi guys, I was wondering whether it was possible to set the bounding box around a text object so that it comes right up to the actual pixels. Is this possible at all? Is this possible via the API?

I know that the text object has the rawTop and rawLeft properties, but as far as I see there is no rawHeight and rawWidth. I guess I can figure out what the difference is between the left and rawLeft and assume that the padding is consistent, but this seems hackey, and still leaves the problem of the setting the bounding box to those dimensions.

So in other words, I'd like to make it so that when a text object is selected the bounding box comes up right to the actual characters and this is reflected in the height and width properties of the text object whose left and top property should now match up with the rawLeft and rawTop properties. Any ideas?

Thank you in advance for all of your help!


There's definitely a rawHeight and rawWidth. Would that solve your problem?

#3 mitya777

mitya777

    FireStarter

  • Members
  • PipPip
  • 28 posts

Posted 10 February 2011 - 03:14 PM

There's definitely a rawHeight and rawWidth. Would that solve your problem?


Ok, I missed it in the API. That would solve some of my problem... is there a way to set the Bounding Box through the API? What I mean is when you select a text object on canvas there is approximately a 2-3 pixel space between the box and the pixels of the actual characters. I want to call some funtions that will set it so that the space is eliminated.

#4 fuuuuu

fuuuuu

    FireworksFreak

  • Members
  • PipPip
  • 19 posts

Posted 11 February 2011 - 03:34 PM

Ok, I missed it in the API. That would solve some of my problem... is there a way to set the Bounding Box through the API? What I mean is when you select a text object on canvas there is approximately a 2-3 pixel space between the box and the pixels of the actual characters. I want to call some funtions that will set it so that the space is eliminated.


Hmn, I'm not sure but I don't think so. Why exactly do you need to do that? Are you trying to eliminate the space for easy calculations? Or just trying to make the text sit right where the bounding box is? If you want the latter you could just try rawHeight = height, or rawWidth = width, and the text would shift over to where the bounding box is.

#5 mitya777

mitya777

    FireStarter

  • Members
  • PipPip
  • 28 posts

Posted 11 February 2011 - 03:52 PM

Hmn, I'm not sure but I don't think so. Why exactly do you need to do that? Are you trying to eliminate the space for easy calculations? Or just trying to make the text sit right where the bounding box is? If you want the latter you could just try rawHeight = height, or rawWidth = width, and the text would shift over to where the bounding box is.


Hey fuuuu, yes it was for some calculations that I am doing but I think I can get by with the raw properties. Thanks for the heads up on rawHeight and rawWidth!

#6 jdunning

jdunning

    Fireworks Ninja

  • Members
  • PipPipPipPipPip
  • 173 posts

Posted 17 February 2011 - 11:52 PM

What I mean is when you select a text object on canvas there is approximately a 2-3 pixel space between the box and the pixels of the actual characters. I want to call some funtions that will set it so that the space is eliminated.

There's always exactly 2px between textBlock.rawTop and textBlock.pixelRect.top. You can't change it, unfortunately, so just need to take the 2px per side into account.

#7 geoff

geoff

    Fireworks Sparkle

  • Members
  • Pip
  • 2 posts

Posted 15 August 2011 - 07:08 AM

You just have to edit the FW Setting "customization"