medley icon indicating copy to clipboard operation
medley copied to clipboard

Shift-snapped bitmap cleared in TEdit when changing scale

Open pamoroso opened this issue 2 years ago • 4 comments

Describe the bug After pasting into TEdit a bitmap captured by Shift-snapping, when using the Change Scale option to change the scale factor to anything > 1 the bitmap is cleared and replaced by a white area of the corresponding size.

To Reproduce Steps to reproduce the behavior:

  1. sign into your Interlisp Online account
  2. under Initial Exec, select Interlisp
  3. click Run Medley
  4. open a TEdit window
  5. use Shift-RightClick-SNAP to capture a portion of the screen such as the Medley logo window
  6. in TEdit, left-click the captured bitmap and select Change Scale
  7. enter 1.5 and press ENTER

Expected behavior The bitmap stays visible.

Screenshots The TEdit window after capturing the bitmap:

bitmap-change-scale1

The TEdit window after Change Scale:

bitmap-change-scale2

The full desktop after Change Scale:

bitmap-change-scale3

Context (please complete the following information):

  • OS: chromeOS Stable
  • OS Version: 119.0.6045.192
  • Host arch: x86_64 (ASUS Chromebox 3)
  • Maiko version: N/A
  • IL:MAKESYSDATE: 15-Sep-2023 23:14:52

Additional context After Change Scale it's still possible to operate on the bitmap and all the options of the left-click menu seem to work. The bitmap is just not displayed but its area has the appropriate size set by the scale factor. Changing the scale factor to anything <= 1 restores the visibility of the bitmap.

pamoroso avatar Dec 10 '23 13:12 pamoroso

The fault appears to be in EXPANDBM which is producing a blank bitmap as the result of expanding the source bitmap.

nbriggs avatar Dec 10 '23 19:12 nbriggs

But it also appears that the bitmap is being dropped out of the piece table (old and new Tedit).

On Dec 10, 2023, at 11:10 AM, Nick Briggs @.***> wrote:

The fault appears to be in EXPANDBM which is producing a blank bitmap as the result of expanding the source bitmap.

— Reply to this email directly, view it on GitHub https://github.com/Interlisp/medley/issues/1457#issuecomment-1849054091, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQSTUJNOWYINUGQPQIWAR33YIYCLVAVCNFSM6AAAAABAOSQMOCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBZGA2TIMBZGE. You are receiving this because you are subscribed to this thread.

rmkaplan avatar Dec 10 '23 19:12 rmkaplan

You can observe the problem without TEDIT's involvement by doing something like this:

(INSPECT (SETQ BADBM (EXPANDBITMAP (BITMAPCOPY LOGOW) 1.5 1.5)))

EXPANDBITMAP calls EXPANDBM to do the work, but I suspect it really only works on integral scale factors. See also SHRINKBITMAP

nbriggs avatar Dec 10 '23 19:12 nbriggs

I looked more carefully at Tedit. It seems that the image object is there, and can be redisplayed if you click somewhere in its new (larger) region and scale it back down. So, not a Tedit problem.

On Dec 10, 2023, at 11:26 AM, Nick Briggs @.***> wrote:

You can observe the problem without TEDIT's involvement by doing something like this:

(INSPECT (SETQ BADBM (EXPANDBITMAP (BITMAPCOPY LOGOW) 1.5 1.5))) EXPANDBITMAP calls EXPANDBM to do the work, but I suspect it really only works on integral scale factors. See also SHRINKBITMAP

— Reply to this email directly, view it on GitHub https://github.com/Interlisp/medley/issues/1457#issuecomment-1849058367, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQSTUJN62IH6LQXCCTMYTELYIYEHJAVCNFSM6AAAAABAOSQMOCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBZGA2TQMZWG4. You are receiving this because you commented.

rmkaplan avatar Dec 11 '23 07:12 rmkaplan