~ubuntu-branches/ubuntu/vivid/nip2/vivid-proposed

« back to all changes in this revision

Viewing changes to src/imagepresent.c

  • Committer: Bazaar Package Importer
  • Author(s): Jay Berkenbilt
  • Date: 2010-12-27 14:53:08 UTC
  • mfrom: (2.1.12 sid)
  • Revision ID: james.westby@ubuntu.com-20101227145308-vampjbuuft281j3l
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
852
852
 
853
853
        case IMAGEMODEL_PEN:
854
854
        case IMAGEMODEL_SMUDGE:
 
855
                imagemodel_refresh_nib( imagemodel );
855
856
                imagepresent_snap_point( ip, x, y, &x, &y );
856
857
                conversion_disp_to_im( conv, x, y, &ix, &iy );
857
858
                ip->paint_last_x = ix;
860
861
                break;
861
862
 
862
863
        case IMAGEMODEL_LINE:
 
864
                imagemodel_refresh_nib( imagemodel );
863
865
                imagepresent_snap_point( ip, x, y, &x, &y );
864
866
                conversion_disp_to_im( conv, x, y, &ix, &iy );
865
867
                ip->paint_last_x = ix;
919
921
{
920
922
        Imagemodel *imagemodel = ip->imagemodel;
921
923
        Conversion *conv = imagemodel->conv;
922
 
        Imageinfo *imageinfo = imagemodel->iimage->value.ii;
 
924
        Imageinfo *imageinfo = conv->ii;
923
925
        Rect oper;
924
926
        int ix, iy;
925
927
 
938
940
 
939
941
        case IMAGEMODEL_PEN:
940
942
                if( !imageinfo_paint_line( imageinfo, 
941
 
                        imagemodel->ink, imagemodel->nib, 
 
943
                        imagemodel->ink, 
 
944
                        imagemodel->nib, 
942
945
                        ip->paint_last_x, ip->paint_last_y, ix, iy ) )
943
946
                        iwindow_alert( GTK_WIDGET( ip ), GTK_MESSAGE_ERROR );
944
947
 
949
952
                        DESTROY_GTK( ip->regionview );
950
953
 
951
954
                        if( !imageinfo_paint_line( imageinfo, 
952
 
                                imagemodel->ink, imagemodel->nib, 
 
955
                                imagemodel->ink, 
 
956
                                imagemodel->nib, 
953
957
                                ip->floating.left, ip->floating.top,
954
958
                                IM_RECT_RIGHT( &ip->floating ),
955
959
                                IM_RECT_BOTTOM( &ip->floating ) ) )
1036
1040
imagepresent_left_release( Imagepresent *ip, GdkEvent *ev, int x, int y )
1037
1041
{
1038
1042
        Imagemodel *imagemodel = ip->imagemodel;
1039
 
        Row *row = HEAPMODEL( imagemodel->iimage )->row;
 
1043
        Row *row = imagemodel->iimage ? 
 
1044
                HEAPMODEL( imagemodel->iimage )->row : NULL;
1040
1045
 
1041
1046
        switch( imagemodel->state ) {
1042
1047
        case IMAGEMODEL_SELECT:
1142
1147
{
1143
1148
        Imagemodel *imagemodel = ip->imagemodel;
1144
1149
        Conversion *conv = imagemodel->conv;
1145
 
        Imageinfo *imageinfo = imagemodel->iimage->value.ii;
 
1150
        Imageinfo *imageinfo = conv->ii;
1146
1151
        Rect oper;
1147
1152
        int x, y;
1148
1153
        int ix, iy;
1176
1181
 
1177
1182
        case IMAGEMODEL_PEN:
1178
1183
                if( !imageinfo_paint_line( imageinfo, 
1179
 
                        imagemodel->ink, imagemodel->nib, 
 
1184
                        imagemodel->ink, 
 
1185
                        imagemodel->nib, 
1180
1186
                        ip->paint_last_x, ip->paint_last_y, ix, iy ) )
1181
1187
                        iwindow_alert( GTK_WIDGET( ip ), GTK_MESSAGE_ERROR );
1182
1188
                im_invalidate( imageinfo_get( FALSE, imageinfo ) );
1692
1698
                G_CALLBACK( imagepresent_imagemodel_imageinfo_changed_cb ), 
1693
1699
                ip );
1694
1700
        imagedisplay_set_conversion( ip->id, imagemodel->conv );
1695
 
        imagemodel->iimage->views = 
1696
 
                g_slist_prepend( imagemodel->iimage->views, ip );
 
1701
 
 
1702
        if( imagemodel->iimage )
 
1703
                imagemodel->iimage->views = 
 
1704
                        g_slist_prepend( imagemodel->iimage->views, ip );
1697
1705
}
1698
1706
 
1699
1707
/* Make a new Imagepresent.