~ubuntu-branches/ubuntu/oneiric/gimp/oneiric-security

« back to all changes in this revision

Viewing changes to plug-ins/common/grid.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-02-26 19:10:31 UTC
  • mfrom: (1.1.22 upstream) (0.4.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100226191031-d11l96bebdllen1n
Tags: 2.6.8-2ubuntu1
* Merge with debian, remaining changes:
  + debian/patches/02_help-message.patch,
    debian/patches/03_gimp.desktop.in.in.patch:
    - updated some strings for ubuntu
  + debian/rules:
    - updated translation templates
  + debian/control:
    - set Vcs-Bzr url

Show diffs side-by-side

added added

removed removed

Lines of Context:
408
408
    {
409
409
      gimp_pixel_rgn_get_row (&srcPR, dest, sx1, y, (sx2 - sx1));
410
410
 
411
 
      y_offset = y - grid_cfg.voffset;
 
411
      y_offset = y - grid_cfg.hoffset;
412
412
      while (y_offset < 0)
413
 
        y_offset += grid_cfg.vspace;
 
413
        y_offset += grid_cfg.hspace;
414
414
 
415
415
      if ((y_offset +
416
 
           (grid_cfg.hwidth / 2)) % grid_cfg.vspace < grid_cfg.hwidth)
 
416
           (grid_cfg.hwidth / 2)) % grid_cfg.hspace < grid_cfg.hwidth)
417
417
        {
418
418
          for (x = sx1; x < sx2; x++)
419
419
            {
424
424
 
425
425
      for (x = sx1; x < sx2; x++)
426
426
        {
427
 
          x_offset = grid_cfg.hspace + x - grid_cfg.hoffset;
 
427
          x_offset = grid_cfg.vspace + x - grid_cfg.voffset;
428
428
          while (x_offset < 0)
429
 
            x_offset += grid_cfg.hspace;
 
429
            x_offset += grid_cfg.vspace;
430
430
 
431
431
          if ((x_offset +
432
 
               (grid_cfg.vwidth / 2)) % grid_cfg.hspace < grid_cfg.vwidth)
 
432
               (grid_cfg.vwidth / 2)) % grid_cfg.vspace < grid_cfg.vwidth)
433
433
            {
434
434
              pix_composite (&dest[(x-sx1) * bytes],
435
435
                             vcolor, bytes, blend, alpha);
436
436
            }
437
437
 
438
438
          if ((x_offset +
439
 
               (grid_cfg.iwidth / 2)) % grid_cfg.hspace < grid_cfg.iwidth
 
439
               (grid_cfg.iwidth / 2)) % grid_cfg.vspace < grid_cfg.iwidth
440
440
              &&
441
 
              ((y_offset % grid_cfg.vspace >= grid_cfg.ispace
 
441
              ((y_offset % grid_cfg.hspace >= grid_cfg.ispace
442
442
                &&
443
 
                y_offset % grid_cfg.vspace < grid_cfg.ioffset)
 
443
                y_offset % grid_cfg.hspace < grid_cfg.ioffset)
444
444
               ||
445
 
               (grid_cfg.vspace -
446
 
                (y_offset % grid_cfg.vspace) >= grid_cfg.ispace
 
445
               (grid_cfg.hspace -
 
446
                (y_offset % grid_cfg.hspace) >= grid_cfg.ispace
447
447
                &&
448
 
                grid_cfg.vspace -
449
 
                (y_offset % grid_cfg.vspace) < grid_cfg.ioffset)))
 
448
                grid_cfg.hspace -
 
449
                (y_offset % grid_cfg.hspace) < grid_cfg.ioffset)))
450
450
            {
451
451
              pix_composite (&dest[(x-sx1) * bytes],
452
452
                             icolor, bytes, blend, alpha);
454
454
        }
455
455
 
456
456
      if ((y_offset +
457
 
           (grid_cfg.iwidth / 2)) % grid_cfg.vspace < grid_cfg.iwidth)
 
457
           (grid_cfg.iwidth / 2)) % grid_cfg.hspace < grid_cfg.iwidth)
458
458
        {
459
459
          for (x = sx1; x < sx2; x++)
460
460
            {
461
 
              x_offset = grid_cfg.hspace + x - grid_cfg.hoffset;
 
461
              x_offset = grid_cfg.vspace + x - grid_cfg.voffset;
462
462
              while (x_offset < 0)
463
 
                x_offset += grid_cfg.hspace;
 
463
                x_offset += grid_cfg.vspace;
464
464
 
465
 
              if ((x_offset % grid_cfg.hspace >= grid_cfg.ispace
 
465
              if ((x_offset % grid_cfg.vspace >= grid_cfg.ispace
466
466
                   &&
467
 
                   x_offset % grid_cfg.hspace < grid_cfg.ioffset)
 
467
                   x_offset % grid_cfg.vspace < grid_cfg.ioffset)
468
468
                  ||
469
 
                  (grid_cfg.hspace -
470
 
                   (x_offset % grid_cfg.hspace) >= grid_cfg.ispace
 
469
                  (grid_cfg.vspace -
 
470
                   (x_offset % grid_cfg.vspace) >= grid_cfg.ispace
471
471
                   &&
472
 
                   grid_cfg.hspace -
473
 
                   (x_offset % grid_cfg.hspace) < grid_cfg.ioffset))
 
472
                   grid_cfg.vspace -
 
473
                   (x_offset % grid_cfg.vspace) < grid_cfg.ioffset))
474
474
                {
475
475
                  pix_composite (&dest[(x-sx1) * bytes],
476
476
                                 icolor, bytes, blend, alpha);
692
692
  gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (width), 2, xres, TRUE);
693
693
 
694
694
  /*  set the size (in pixels) that will be treated as 0% and 100%  */
695
 
  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (width), 0, 0.0, drawable->width);
696
 
  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (width), 1, 0.0, drawable->height);
 
695
  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (width), 0, 0.0, drawable->height);
 
696
  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (width), 1, 0.0, drawable->width);
697
697
  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (width), 2, 0.0, drawable->width);
698
698
 
699
699
  /*  set upper and lower limits (in pixels)  */
700
700
  gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (width), 0, 0.0,
701
 
                                         drawable->width);
 
701
                                         drawable->height);
702
702
  gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (width), 1, 0.0,
703
 
                                         drawable->height);
 
703
                                         drawable->width);
704
704
  gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (width), 2, 0.0,
705
705
                                         MAX (drawable->width,
706
706
                                              drawable->height));
766
766
  gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (space), 2, xres, TRUE);
767
767
 
768
768
  /*  set the size (in pixels) that will be treated as 0% and 100%  */
769
 
  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (space), 0, 0.0, drawable->width);
770
 
  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (space), 1, 0.0, drawable->height);
 
769
  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (space), 0, 0.0, drawable->height);
 
770
  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (space), 1, 0.0, drawable->width);
771
771
  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (space), 2, 0.0, drawable->width);
772
772
 
773
773
  /*  set upper and lower limits (in pixels)  */
774
774
  gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (space), 0, 1.0,
775
 
                                         drawable->width);
 
775
                                         drawable->height);
776
776
  gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (space), 1, 1.0,
777
 
                                         drawable->height);
 
777
                                         drawable->width);
778
778
  gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (space), 2, 0.0,
779
779
                                         MAX (drawable->width,
780
780
                                              drawable->height));
833
833
  gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (offset), 2, xres, TRUE);
834
834
 
835
835
  /*  set the size (in pixels) that will be treated as 0% and 100%  */
836
 
  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (offset), 0, 0.0, drawable->width);
837
 
  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (offset), 1, 0.0, drawable->height);
 
836
  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (offset), 0, 0.0, drawable->height);
 
837
  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (offset), 1, 0.0, drawable->width);
838
838
  gimp_size_entry_set_size (GIMP_SIZE_ENTRY (offset), 2, 0.0, drawable->width);
839
839
 
840
840
  /*  set upper and lower limits (in pixels)  */
841
841
  gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (offset), 0, 0.0,
842
 
                                         drawable->width);
 
842
                                         drawable->height);
843
843
  gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (offset), 1, 0.0,
844
 
                                         drawable->height);
 
844
                                         drawable->width);
845
845
  gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (offset), 2, 0.0,
846
846
                                         MAX (drawable->width,
847
847
                                              drawable->height));